Submission #976018

# Submission time Handle Problem Language Result Execution time Memory
976018 2024-05-06T05:16:41 Z vjudge1 Pizza (COCI21_pizza) C++11
0 / 50
40 ms 504 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define pb push_back
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout); // REMBEMBER TO COMMENT THIS BEFORE SUBMITTING

    int n;
    cin >> n;
    set<int> s;
    for (int i = 0; i < n; i++)
    {
        int x;
        cin >> x;
        s.insert(x);
    }
    int ans = 0;
    int m;
    cin >> m;
    vector<vi> b(m);
    for (int i = 0; i < m; i++)
    {
        int k;
        cin >> k;
        for (int j = 0; j < k; j++)
        {
            int z;
            cin >> z;
            b[i].pb(z);
        }
    }
    for (auto i : b)
    {
        bool can = true;
        for (auto j : i)
        {
            if (s.count(j))
                can = 0;
        }
        ans += can;
    }
    cout << ans;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:11:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     freopen("input.txt", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:12:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     freopen("output.txt", "w", stdout); // REMBEMBER TO COMMENT THIS BEFORE SUBMITTING
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 500 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 40 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -