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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int N;
void Ramen(int _N)
{
int i, j;
N=_N;
vector<int> A, B;
for(i=0; i+1<N; i+=2)
{
int t=Compare(i, i+1);
if(t==1) A.push_back(i), B.push_back(i+1);
else B.push_back(i), A.push_back(i+1);
}
if(N%2) A.push_back(N-1), B.push_back(N-1);
int X=A[0];
for(i=1; i<A.size(); i++)
{
int t=Compare(X, A[i]);
if(t==-1) X=A[i];
}
int Y=B[0];
for(i=1; i<B.size(); i++)
{
int t=Compare(Y, B[i]);
if(t==1) Y=B[i];
}
Answer(Y, X);
}
Compilation message (stderr)
ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:27:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=1; i<A.size(); i++)
~^~~~~~~~~
ramen.cpp:34:12: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=1; i<B.size(); i++)
~^~~~~~~~~
ramen.cpp:13:9: warning: unused variable 'j' [-Wunused-variable]
int i, j;
^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |