当前位置:网站首页>Codecraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined) C. Felicity is Coming!
Codecraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined) C. Felicity is Coming!
2022-06-26 02:03:00 【No toast】
#include<bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define eps 1e-2
#define gcd __gcd
#define pb push_back
#define PI acos(-1.0)
#define lowbit(x) (x)&(-x)
#define bug printf("!!!!!\n");
#define mem(x,y) memset(x,y,sizeof(x))
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef unsigned long long uLL;
const int maxn = 1e6+2;
const int INF = 1<<30;
const int mod = 1e9+7;
int n,m;
std::vector<int> v[maxn];
void solve(){
scanf("%d%d",&n,&m);
for(int i=1;i<=n;i++){
int x,y;scanf("%d",&x);
for(int j=1;j<=x;j++){
scanf("%d",&y);
v[y].push_back(i);
}
}
for(int i=1;i<=m;i++) sort(v[i].begin(),v[i].end());
sort(v+1,v+1+m);
LL ans=1,cnt=1;
for(int i=2;i<=m;i++){
if(v[i]==v[i-1]){
++cnt;
}else cnt=1;
ans=ans*cnt%mod;
}
cout<<ans<<endl;
return;
}
int main()
{
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
// ios::sync_with_stdio(false);
int t = 1;
//scanf("%d",&t);
while(t--){
// printf("Case %d: ",cas++);
solve();
}
return 0;
}
边栏推荐
- 高手常用的电脑快捷键
- Connectez Le projecteur
- Two indicators for determining the value of points to the business
- Is the securities account recommended by qiniu safe?
- 将lua print输出到cocos2d控制台输出窗口中
- General introduction to gun make (2)
- Gun make (5) variables in makefile
- -- EGFR FISH probe solution
- tos cos dscp 区别和作用
- 记录一个诡异的图片上传问题
猜你喜欢

接口测试用例设计

通俗易懂C语言关键字static

Dataframe to list

Pointnet/Pointnet++学习

Tengwenze, a hot-blooded boy, was invited to serve as the image ambassador of the global finals of the sixth season perfect children's model

安装了Visual Studio 2013 Redistributable,mysql还是安装失败

Chrome浏览器开发者工具使用

qtvtkvs2015测试代码

二造实务案例答题技巧和举例汇总,满满都是精髓

shell学习记录(一)
随机推荐
wifi 的理论速度计算方法
Weishi camera display
二造实务案例答题技巧和举例汇总,满满都是精髓
Redis-链表
Playful girl wangyixuan was invited to serve as the Promotion Ambassador for the global finals of the sixth season perfect children's model
recvmsg & sendmsg
标定。。。
安装了Visual Studio 2013 Redistributable,mysql还是安装失败
一分钟了解同步、异步、阻塞和非阻塞的区别
其他代码,,vt,,,k
Use of redis
xargs 的作用详解
vscode调试时提示更新到最新调试版本
SDRAM控制器——仲裁模块的实现
Gun make (7) execute make
Finding the sum of N multiplications
Three factors affecting personal growth
PTA class a simulated first bomb: 1132-1135
Redis7.0的安装步骤
Pixel6 unlock bootloader