제출 #1019990

#제출 시각아이디문제언어결과실행 시간메모리
1019990presko게임 (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; }

컴파일 시 표준 에러 (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...