Submission #977373

# Submission time Handle Problem Language Result Execution time Memory
977373 2024-05-07T20:03:17 Z vjudge1 Pizza (COCI21_pizza) C++11
0 / 50
1 ms 600 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int M, N;
    cin >> M >> N;

    vector<unordered_set<string>> bingkisan(M);
    for (int i = 0; i < M; ++i) {
        int K;
        cin >> K;
        for (int j = 0; j < K; ++j) {
            string camilan;
            cin >> camilan;
            bingkisan[i].insert(camilan);
        }
    }

    unordered_set<string> tidak_disukai;
    for (int i = 0; i < N; ++i) {
        string camilan;
        cin >> camilan;
        tidak_disukai.insert(camilan);
    }

    int jumlah_bingkisan_dapat_dibeli = 0;
    for (const auto& bingkisan_set : bingkisan) {
        bool semua_camilan_dapat_diterima = true;
        for (const auto& camilan : bingkisan_set) {
            if (tidak_disukai.count(camilan) > 0) {
                semua_camilan_dapat_diterima = false;
                break;
            }
        }
        if (semua_camilan_dapat_diterima) {
            jumlah_bingkisan_dapat_dibeli++;
        }
    }

    cout << jumlah_bingkisan_dapat_dibeli << endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -