Submission #975965

# Submission time Handle Problem Language Result Execution time Memory
975965 2024-05-06T04:04:24 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 600 KB
#include <bits/stdc++.h>

using namespace std;

int main(){
    int n; cin >> n;
    int a[n+1];

    for(int i = 0; i < n; i++){
        cin >> a[i];
    }

    int m; cin >> m;
    int cnt = 0;
    while(m--){
        int k; cin >> k;
        int b[k+1];
        bool flag = true;
        for(int i = 0; i < k; i++){
            cin >> b[i];
        }

        for(int i = 0; i < n; i++){
            for(int j = 0; j < k; j++){
                if(a[i] == b[j]){
                    flag = false;
                    goto mem;
                }
            }
        }
        mem:
        if(flag) cnt++;
    }

    cout << cnt << endl;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 600 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 348 KB Output is correct
2 Correct 1 ms 348 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 0 ms 348 KB Output is correct
2 Correct 0 ms 344 KB Output is correct