Submission #6005

# Submission time Handle Problem Language Result Execution time Memory
6005 2014-06-14T02:18:20 Z kriii 라멘 (JOI14_ramen) C++
100 / 100
0 ms 1124 KB
#include "ramen.h"
#include <vector>

void Ramen(int N) {
	int l=-1,r=-1;
	if (N % 2) l = r = N-1;
	for (int i=0;i<N-1;i+=2){
		int x = i, y = i + 1, t;
		if (Compare(i,i+1) == 1) t = x, x = y, y = t;
		if (l == -1 || Compare(x,l) == -1) l = x;
		if (r == -1 || Compare(r,y) == -1) r = y;
	}
	Answer(l,r);
}

Compilation message


# 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