# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
987633 | kim | Game (IOI14_game) | C++17 | 1062 ms | 4728 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;
bool adj[1505][1505];
int n;
bitset<1505> vis;
void dfs(int u){
vis[u]=1;
for(int i=0;i<n;++i) if(!adj[u][i]&&!vis[i]) dfs(i);
}
void initialize(int n) {
::n=n;
}
int hasEdge(int u, int v) {
adj[u][v]=adj[v][u]=1;
vis.reset(), dfs(0);
if(n!=vis.count()) adj[u][v]=adj[v][u]=0;
return !adj[u][v];
}
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... |