# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
284947 | triplem5ds | Game (IOI14_game) | C++14 | 1090 ms | 728 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "game.h"
#include "bits/stdc++.h"
using namespace std;
bitset<1505> cnc[1505];
int N;
void initialize(int n) {
N = n;
for(int i = 0; i < n; i++)
for(int j = i + 1; j < n; j++)
cnc[i][j] = cnc[j][i] = 1;
}
bitset<1505> cur;
int dfs(int node){
int ans = 1;
cur[node] = 0;
bitset<1505> to = cur & cnc[node];
cur &= ~to;
for(auto x = to._Find_first(); x < N; x = to._Find_next(x)){
ans += dfs(x);
}
return ans;
}
int hasEdge(int u, int v) {
cnc[u][v] = cnc[v][u] = 0;
for(int i = 0; i < N; i++)cur.set(i);
if(dfs(0) != N){
cnc[u][v] = cnc[v][u] = 1;
return 1;
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |