# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
18652 |
2016-02-13T10:19:44 Z |
mindol |
라멘 (JOI14_ramen) |
C++14 |
|
0 ms |
1180 KB |
#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
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 |
1 |
Correct |
0 ms |
1180 KB |
Output is correct |
2 |
Correct |
0 ms |
1180 KB |
Output is correct |
3 |
Correct |
0 ms |
1180 KB |
Output is correct |
4 |
Correct |
0 ms |
1180 KB |
Output is correct |
5 |
Correct |
0 ms |
1180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1180 KB |
Output is correct |
2 |
Correct |
0 ms |
1180 KB |
Output is correct |
3 |
Correct |
0 ms |
1180 KB |
Output is correct |
4 |
Correct |
0 ms |
1180 KB |
Output is correct |
5 |
Correct |
0 ms |
1180 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1180 KB |
Output is correct |
2 |
Correct |
0 ms |
1180 KB |
Output is correct |
3 |
Correct |
0 ms |
1180 KB |
Output is correct |
4 |
Correct |
0 ms |
1180 KB |
Output is correct |
5 |
Correct |
0 ms |
1180 KB |
Output is correct |