Submission #975530

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

map<int,int> angka;
int main(){
int n, m, k, b;
int hasil = 0;
cin >> n;
for(int i = 0; i< n; i++){
    int a;
    cin >> a;
    angka.insert(pair<int,int>(a, 1));
}
cin >> m;
for(int l = 0; l< m; l++){
    cin >> b;
    bool ada = false;
    for(int k = 0; k< b; k++){
        int y;
        cin >> y;
        if(ada == false){
            if(angka.count(y)== 1){
                ada = true;
            }
        }
    }
    if(ada == false){
        hasil++;
    }
}
cout << hasil << endl;
    return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:6:11: warning: unused variable 'k' [-Wunused-variable]
    6 | int n, m, k, b;
      |           ^
# 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 344 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 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct