当前位置:网站首页>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;
}
边栏推荐
猜你喜欢

俏皮少女王艺璇 受邀担任第六季完美童模全球总决赛推广大使

NDK20b FFmpeg4.2.2 编译和集成

甜酷少女金书伊 受邀担任第六季完美童模全球总决赛代言人

GUN make (2) 总述

论文阅读 Exploring Temporal Information for Dynamic Network Embedding

biggan:large scale gan training for high fidelity natural image synthesis

Redis7.0 installation steps

关于strlen与sizeof的区别

Mot - clé C facile à comprendre statique

通俗易懂C語言關鍵字static
随机推荐
PTA class a simulated first bomb: 1132-1135
Detailed explanation of WiFi related knowledge
biggan:large scale gan training for high fidelity natural image synthesis
easyexcel读取文件
图形渲染管线
轻轻松松理解指针
PTA class a simulated third bomb: 1140-1143
Two indicators for determining the value of points to the business
Record a weird picture upload problem
热血男孩滕文泽 受邀担任第六季完美童模全球总决赛形象大使
regular expression
Application and chemical properties of elastase
Cs144 environment configuration
甜酷少女金书伊 受邀担任第六季完美童模全球总决赛代言人
UN make (6) makefile的条件执行
cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network
UN make (6) conditional execution of makefile
Abnova anti GBA monoclonal antibody solution
Difference between app test and web test
shell学习记录(四)