Submission #974583

# Submission time Handle Problem Language Result Execution time Memory
974583 2024-05-03T13:30:37 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 428 KB
#include<bits/stdc++.h>
using namespace std;

int n, m, ans = 0;
bool b[105] = {0};
int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        int a; cin >> a; b[a] = 1;
    }
    cin >> m;
    while(m--){
        int k; cin >> k;
        bool yo = 1;
        for(int i = 1; i <= k; i++){
            int x; cin >> x;
            if(b[x] == 1){
                //cout << x << endl;
                yo = 0;
            }
        }
        if(yo) ans++;
    }
    cout << ans;
}
/*
3 7 2 4
5
3 1 2 3
3 4 5 6
3 7 8 9
3 1 3 6
3 2 4 7
*/
# Verdict Execution time Memory Grader output
1 Correct 1 ms 428 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 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 1 ms 344 KB Output is correct
2 Correct 0 ms 360 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