답안 #381867

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
381867 2021-03-26T06:03:43 Z Slavita Pizza (COCI21_pizza) C++14
50 / 50
1 ms 492 KB
#include <bits/stdc++.h>
#define ve vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pi pair<int,int>
#define all(v) v.begin(),v.end()
#define si(v) (int)v.size()
#define en '\n'
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

const int N = 1e2 + 228;
const int big = 1e9;
int n, b[N], c[N][N], m;

int main(){
    iostream::sync_with_stdio(false); cin.tie(0); ios_base::sync_with_stdio(false); cout.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin >> n;
    for (int i = 1; i <= n; i++) {int x; cin >> x; b[x] = 1;}
    cin >> m;
    int ans = 0;
    for (int i = 1; i <= m; i++){
        int k; cin >> k;
        bool ok = 1;
        for (int j = 1; j <= k; j++){
            int x; cin >> x;
            if (b[x] == 1) ok = 0;
        }
        if (ok) ans++;
    }
    cout << ans;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 492 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct