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;
int n;
void initialize(int N) {
n=N;
}
vector<int> nodes;
vector<int> adjList[1505];
void dfs(int u,int e)
{
nodes.push_back(u);
for(int v: adjList[u]){
if(e==v) continue;
dfs(v,u);
}
}
int asked[100][100];
int hasEdge(int u, int v) {
nodes.clear();
asked[u][v]=1;
asked[v][u]=1;
adjList[u].push_back(v);
adjList[v].push_back(u);
dfs(u,-1);
for(int i: nodes){
for(int j: nodes){
if(i==j) continue;
if(asked[i][j]==0){
adjList[u].pop_back();
adjList[v].pop_back();
return 0;
}
}
}
return 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |