Submission #4292700


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

int main() {
  int N, M;
  int cnt[31];

  cin >> N >> M;

  for(int i=0; i<M; ++i) cnt[i] = 0;

  for(int i=0; i<N; ++i) {
    int K;
    cin >> K;
    for(int j=0; j<K; ++j) {
      int A;
      cin >> A;
      cnt[A-1] += 1;
    }
  }

  int ans = 0;
  for(int i=0; i<M; ++i) {
    if(cnt[i] == N) ans++;
  }
  cout << ans << endl;
}

Submission Info

Submission Time
Task B - Foods Loved by Everyone
User kivantium
Language C++14 (GCC 5.4.1)
Score 200
Code Size 411 Byte
Status
Exec Time 1 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
All 200 / 200 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 0 / 0 sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_random_1 1 ms 256 KB
0_random_2 1 ms 256 KB
1_max_1 1 ms 256 KB
1_max_2 1 ms 256 KB
2_nmin_1 1 ms 256 KB
3_mmin_1 1 ms 256 KB
4_corner_1 1 ms 256 KB
4_corner_2 1 ms 256 KB
4_corner_3 1 ms 256 KB
5_hand_1 1 ms 256 KB
5_hand_2 1 ms 256 KB
5_hand_3 1 ms 256 KB
sample_01 1 ms 256 KB
sample_02 1 ms 256 KB
sample_03 1 ms 256 KB