Submission #18652

#TimeUsernameProblemLanguageResultExecution timeMemory
18652mindol라멘 (JOI14_ramen)C++14
100 / 100
0 ms1180 KiB
#include "ramen.h" #include<vector> using namespace std; vector<int> win,lose; void Ramen(int N) { for(int i=0,j=1;j<N;i+=2,j+=2) { int res=Compare(i,j); if(res==1) win.push_back(i), lose.push_back(j); else win.push_back(j), lose.push_back(i); } if(N&1) win.push_back(N-1), lose.push_back(N-1); for(int i=0;i<win.size()-1;i++) { int res=Compare(win[i],win[i+1]); if(res==1) win[i+1]=win[i]; } for(int i=0;i<lose.size()-1;i++) { int res=Compare(lose[i],lose[i+1]); if(res==-1) lose[i+1]=lose[i]; } Answer(lose.back(),win.back()); }

Compilation message (stderr)

ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:14:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<win.size()-1;i++)
                  ^
ramen.cpp:19:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<lose.size()-1;i++)
                  ^

#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...