답안 #1104810

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1104810 2024-10-24T13:25:59 Z huantran Pizza (COCI21_pizza) C++17
50 / 50
2 ms 848 KB
#include <bits/stdc++.h>

#define bit(x, i) (((x) >> (i)) & 1)
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define PI acos(-1)
#define all(x) (x.begin(), x.end())
#define sz(x) x.size()
using namespace std;
using ll = long long int;
using vi = vector<int>;
const int INF = 1e9;
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const int maxn = 1e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);

    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> cnt(maxn, 0);
    for (int i = 0; i < n; i++)
        cin >> a[i], cnt[a[i]]++;

    int m;
    cin >> m;
    int ans = 0;

    for (int i = 1; i <= m; i++) {
        int k;
        cin >> k;
        int ck = 1;
        while (k --> 0) {
            int x;
            cin >> x;
            if (cnt[x])
                ck = 0;
        }

        if (ck)
            ans++;
    }

    cout << ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 716 KB Output is correct
2 Correct 1 ms 848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 592 KB Output is correct
2 Correct 1 ms 848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 848 KB Output is correct
2 Correct 2 ms 848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 592 KB Output is correct
2 Correct 1 ms 592 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 848 KB Output is correct
2 Correct 1 ms 848 KB Output is correct