Submission #201673

#TimeUsernameProblemLanguageResultExecution timeMemory
201673DavidDamianGame (IOI14_game)C++11
42 / 100
1070 ms5240 KiB
#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[1505][1505]; 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...