Submission #975661

# Submission time Handle Problem Language Result Execution time Memory
975661 2024-05-05T16:45:23 Z vjudge1 Pizza (COCI21_pizza) C++
50 / 50
1 ms 348 KB
#include <iostream>
#include <vector>
#include <set>

int exist(int el, std::vector<int>& set) {
  int cnt = 0;
  for (int i : set) {
    if (el - i == 0) {
      cnt++;
      break;
    }
  }
  return cnt;
}

int main() {
  int ndislike;
  std::cin >> ndislike;
  std::vector<int> dislike;
  for (int i = 0; i < ndislike; i++) {
    int temp;
    std::cin >> temp;
    dislike.push_back(temp);
  }

  int nbingkisan;
  std::cin >> nbingkisan;
  std::vector<std::vector<int>> set_binks;
  for (int i = 0; i < nbingkisan; i++) {
    int ncemilan;
    std::cin >> ncemilan;
    std::vector<int> setcemilan;
    for (int j = 0; j < ncemilan; j++) {
      int cemil;
      std::cin >> cemil;
      setcemilan.push_back(cemil);
    }
    set_binks.push_back(setcemilan);
  }

  int ans = 0;
  for (std::vector<int>& i : set_binks) {
    int cnt = 0;
    for (int j : i) {
      if (exist(j, dislike) > 0) {
        cnt++;
        break;
      }
    }
    if (cnt == 0) {
      ans++;
    }
  }

  std::cout << ans << std::endl;
  return 0;
}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 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 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 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 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct