Submission #1019990

#TimeUsernameProblemLanguageResultExecution timeMemory
1019990preskoGame (IOI14_game)C++14
100 / 100
268 ms22772 KiB
#include<iostream> #include<vector> #include "game.h" #define MAXN 3000 using namespace std; bool bfl=1; bool used[MAXN][MAXN]; bool comp[MAXN]; vector<int> order; void initialize(int n) { } int hasEdge(int u, int v) { u++;v++; if(bfl) { bfl=0; order.push_back(u); order.push_back(v); comp[u]=1; comp[v]=1; used[u][v]=1; used[v][u]=1; return 1; } if(!comp[u] && comp[v]) { int cntr=0; for(int i=0;i<order.size();i++) { if(!used[u][order[i]])cntr++; } if(cntr==1) { comp[u]=1; order.push_back(u); used[u][v]=1; used[v][u]=1; return 1; } } else if(comp[u] && !comp[v]) { int cntr=0; for(int i=0;i<order.size();i++) { if(!used[v][order[i]])cntr++; } if(cntr==1) { comp[v]=1; order.push_back(v); used[u][v]=1; used[v][u]=1; return 1; } } used[u][v]=1; used[v][u]=1; return 0; }

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:31:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |         for(int i=0;i<order.size();i++)
      |                     ~^~~~~~~~~~~~~
game.cpp:47:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   47 |         for(int i=0;i<order.size();i++)
      |                     ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...