# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
200514 |
2020-02-07T03:25:38 Z |
arnold518 |
라멘 (JOI14_ramen) |
C++14 |
|
5 ms |
376 KB |
#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=A[i];
}
Answer(Y, X);
}
Compilation message
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 |
1 |
Correct |
5 ms |
248 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Runtime error |
5 ms |
256 KB |
Execution failed because the return code was nonzero |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
5 ms |
376 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
5 ms |
248 KB |
Execution failed because the return code was nonzero |
2 |
Halted |
0 ms |
0 KB |
- |