# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
5351 |
2014-04-05T18:09:05 Z |
model_code |
라멘 (JOI14_ramen) |
C++ |
|
0 ms |
1124 KB |
#include "ramen.h"
void Ramen(int N) {
int max_id, min_id, i;
if(N%2 == 1) {
max_id = min_id = N - 1;
} else {
if(Compare(N - 2, N - 1) > 0) {
max_id = N - 2;
min_id = N - 1;
} else {
max_id = N - 1;
min_id = N - 2;
}
}
for(i = 0; i < (N-1)/2; ++i) {
int j, k;
if(Compare(i * 2, i * 2 + 1) > 0) {
j = i * 2;
k = i * 2 + 1;
} else {
j = i * 2 + 1;
k = i * 2;
}
if(Compare(j, max_id) > 0) {
max_id = j;
}
if(Compare(k, min_id) < 0) {
min_id = k;
}
}
Answer(min_id, max_id);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Correct |
0 ms |
1124 KB |
Output is correct |
4 |
Correct |
0 ms |
1124 KB |
Output is correct |
5 |
Correct |
0 ms |
1124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Correct |
0 ms |
1124 KB |
Output is correct |
4 |
Correct |
0 ms |
1124 KB |
Output is correct |
5 |
Correct |
0 ms |
1124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
1124 KB |
Output is correct |
2 |
Correct |
0 ms |
1124 KB |
Output is correct |
3 |
Correct |
0 ms |
1124 KB |
Output is correct |
4 |
Correct |
0 ms |
1124 KB |
Output is correct |
5 |
Correct |
0 ms |
1124 KB |
Output is correct |