Submission #971931

# Submission time Handle Problem Language Result Execution time Memory
971931 2024-04-29T14:04:18 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;


int main() {
  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  int n; cin >> n;
  vector<int> a(n);
  for(int i = 0;i < n;i++) cin >> a[i];
  int m; cin >> m;
  vector<int> k(m), b[m];

  for(int i = 0;i < m; i++) {
    cin >> k[i];
    for(int j = 0;j < k[i]; j++) {
      int x; cin >> x;
      b[i].push_back(x);
    }
  }

  int ans = 0;
  for(int i = 0;i < m; i++) {
    bool cek = true;
    for(int j = 0; j < n; j++) {
      if(find(b[i].begin(), b[i].end(), a[j]) != b[i].end()) {
        cek = false;
        break;
      }
      
    }
    if(cek) ans++;
  }
  cout << ans << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct