Submission #245089

# Submission time Handle Problem Language Result Execution time Memory
245089 2020-07-05T12:56:10 Z Tc14 Political Development (BOI17_politicaldevelopment) C++17
0 / 100
3000 ms 3456 KB
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ve vector
typedef long long ll;

const int MAXN = 5000;

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, k, d, a;
    bool r2, r3;
    vector<bitset<MAXN>> G; 

    cin >> n >> k;
    G = vector<bitset<MAXN>>(n);

    r2 = false;
    for (int i = 0; i < n; i++) {
        cin >> d;
        for (int j = 0; j < d; j++) {
            cin >> a;
            G[i].set(a);
            r2 = true;
        }
    }

    r3 = false;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if ((G[i] & G[j]).any()) {
                r3 = true;
            }
        }
    }

    if (r3) cout << 3 << endl;
    else if (r2) cout << 2 << endl;
    else cout << 1 << endl;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3084 ms 3456 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -