当前位置:网站首页>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 00:24:00 【不吃土司边】
#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;
}
边栏推荐
猜你喜欢

recvmsg & sendmsg

Differences and functions of TOS cos DSCP

readv & writev

Energetic girl wangyujie was invited to be the spokesperson for the global finals of the sixth season perfect children's model

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

Abnova CSV monoclonal antibody solution

tos cos dscp 区别和作用

元气少女王钰洁 受邀担任第六季完美童模全球总决赛代言人

Talking about interface test (I)

What happens from entering a web address in the browser's input box to seeing the contents of the web page?
随机推荐
输入3个整数,从大到小输出出来
Xiaomi tablet 5 Pro unlock bootloader
easyexcel读取文件
How to add a "security lock" to the mobile office of government and enterprises?
LeetCode 31 ~ 40
Computer shortcut keys commonly used by experts
17.11 std:: atomic continuation, std:: async in-depth discussion
GUN make (2) 总述
关于VS scanf出现‘scanf‘: This function or variable may be unsafe. Consider usi问题的解决方法
On the difference between strlen and sizeof
JQ user defined attribute value
Pixel6 unlock bootloader
Cs144 environment configuration
PTA class a simulated sixth bomb: 1156-1159
keda 2.7.1 scaledJob 代码简要分析
Redis7.0的安装步骤
Abnova anti GBA monoclonal antibody solution
readv & writev
Redis的使用
Disruptor(一)Sequence