Submission #18868

# Submission time Handle Problem Language Result Execution time Memory
18868 2016-02-16T06:04:16 Z choyi0521 라멘 (JOI14_ramen) C++14
0 / 100
0 ms 1124 KB
#include "ramen.h"
void Ramen(int N) {
	int l, r;
	if (N % 2) l = r = N - 1;
	for (int i = 1; i < N; i += 2) {
		int x=i-1, y=i;
		if (Compare(x, y) == 1) x ^= y ^= x ^= y;
		if (Compare(l,x) == 1) l = x;
		if (Compare(y,r) == 1) r = y;
	}
	Answer(l, r);
}

Compilation message

ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:9:14: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (Compare(y,r) == 1) r = y;
              ^
ramen.cpp:8:14: warning: 'l' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (Compare(l,x) == 1) l = x;
              ^

# 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 Incorrect 0 ms 1124 KB Wrong Answer [1]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1124 KB Output is correct
2 Incorrect 0 ms 1124 KB Wrong Answer [1]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1124 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -