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 "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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |