| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1351153 | ElayV13 | Game (IOI14_game) | C++20 | 0 ms | 344 KiB |
#include "game.h"
#include "bits/stdc++.h"
using namespace std;
int N;
vector<int>G[1501];
bool used[1501];
void initialize(int n)
{
N=n;
}
void dfs(int v){
used[v]=1;
for(int u:G[v]) if(!used[u]) dfs(u);
}
bool one(){
for(int i=0;i<N;i++) used[i]=0;
dfs(0);
for(int i=0;i<N;i++) if(!used[i]) return 0;
return 1;
}
int hasEdge(int u,int v)
{
G[u].push_back(v);
G[v].push_back(u);
if(one()){
G[u].pop_back();
G[v].pop_back();
return 1;
}
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
