Submission #1104809

# Submission time Handle Problem Language Result Execution time Memory
1104809 2024-10-24T13:25:37 Z huantran Pizza (COCI21_pizza) C++17
0 / 50
3 ms 1016 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() {
    #ifndef ONLINE_JUDGE
        freopen("TASK.inp", "r", stdin);
        freopen("TASK.out", "w", stdout);
    #endif

    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;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:18:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |         freopen("TASK.inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:19:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |         freopen("TASK.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 848 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 848 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 848 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 848 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1016 KB Output isn't correct
2 Halted 0 ms 0 KB -