Submission #974879

# Submission time Handle Problem Language Result Execution time Memory
974879 2024-05-04T05:03:58 Z vjudge1 Pizza (COCI21_pizza) C++17
50 / 50
1 ms 348 KB
#include <bits/stdc++.h>

using namespace std;
int n, m;
string s;

void solve()
{
    cin >> n;
    bool bingkisan[200];
    memset(bingkisan, 1, sizeof(bingkisan));
    int x;
    for (int i = 0; i < n; i++)
    {
        cin >> x;
        bingkisan[x] = false;
    }
    cin >> m;
    int k = 0, ans = 0, no;
    bool valid = true;
    while (m--)
    {
        cin >> k;
        valid = true;
        while (k--)
        {
            cin >> no;
            if (!bingkisan[no])
            {
                valid = false;
            }
        }
        if (valid)
        {
            ans++;
        }
    }
    cout << ans;
}
int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 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 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 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 0 ms 348 KB Output is correct