Submission #975893

# Submission time Handle Problem Language Result Execution time Memory
975893 2024-05-06T02:26:18 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 348 KB
#include <bits/stdc++.h>

using namespace std;

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

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

    int m; cin >> m;

    while(m--){
        int k; cin >> k;
        map<int, int> b;
        //b.clear();

        bool ada = false;
        for(int i = 1; i <= k; i++){
            int x; cin >> x;
            b[x]++;
        }
        for(int i = 1; i <= n; i++){
            if(b.count(a[i]) != 0){
                ada = true;
                break;
            }
        }
        if(!ada) ans++;
    }

    cout << ans << endl;
}
# 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 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 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 348 KB Output is correct