Submission #4280546
Source Code Expand
Copy
#include<vector> #include<cmath> #include<map> #include<cstdlib> #include<iostream> #include<sstream> #include<fstream> #include<string> #include<algorithm> #include<cstring> #include<cstdio> #include<set> #include<stack> #include<bitset> #include<functional> #include<ctime> #include<queue> #include<deque> #include<complex> #include<cassert> using namespace std; #define pb push_back #define pf push_front typedef long long lint; typedef complex<double> P; #define mp make_pair #define fi first #define se second typedef pair<int,int> pint; #define All(s) s.begin(),s.end() #define rAll(s) s.rbegin(),s.rend() #define REP(i,a,b) for(int i=a;i<b;i++) #define rep(i,n) REP(i,0,n) //問題文および制約はちゃんと確認しよう! //サイズは10^5じゃなくて2×10^5とかかもしれないし、重要な制約・条件を見落としているかも //とりあえずサンプルを読んでから解法を考えよう? int a[40]; int main() { int n,m,k,x; memset(a,0,sizeof(a)); cin>>n>>m; rep(i,n){ cin>>k; rep(j,k){ cin>>x;x--;a[x]++; } } int out=0; rep(i,m){ if(a[i]>=n) out++; } cout<<out<<endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Foods Loved by Everyone |
User | sky58 |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1194 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | All | Sample | ||||
---|---|---|---|---|---|---|
Score / Max Score | 200 / 200 | 0 / 0 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
All | 0_random_1, 0_random_2, 1_max_1, 1_max_2, 2_nmin_1, 3_mmin_1, 4_corner_1, 4_corner_2, 4_corner_3, 5_hand_1, 5_hand_2, 5_hand_3, sample_01, sample_02, sample_03 |
Sample | sample_01, sample_02, sample_03 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_random_1 | AC | 1 ms | 256 KB |
0_random_2 | AC | 1 ms | 256 KB |
1_max_1 | AC | 1 ms | 256 KB |
1_max_2 | AC | 1 ms | 256 KB |
2_nmin_1 | AC | 1 ms | 256 KB |
3_mmin_1 | AC | 1 ms | 256 KB |
4_corner_1 | AC | 1 ms | 256 KB |
4_corner_2 | AC | 1 ms | 256 KB |
4_corner_3 | AC | 1 ms | 256 KB |
5_hand_1 | AC | 1 ms | 256 KB |
5_hand_2 | AC | 1 ms | 256 KB |
5_hand_3 | AC | 1 ms | 256 KB |
sample_01 | AC | 1 ms | 256 KB |
sample_02 | AC | 1 ms | 256 KB |
sample_03 | AC | 1 ms | 256 KB |