Submission #5354

# Submission time Handle Problem Language Result Execution time Memory
5354 2014-04-05T19:06:23 Z ainta 라멘 (JOI14_ramen) C++
0 / 100
0 ms 1124 KB
#include "ramen.h"
bool v1[410], v2[410];
void Ramen(int N) {
	int i, t, p, c, r1, r2;
	while (1){
		t = -1;
		c = 0;
		for (i = 0; i < N; i++){
			if (!v1[i]){
				c++;
				r1 = i;
				if (t == -1) t = i;
				else{
					p = Compare(t, i);
					if (p == 1) v1[i] = true, v2[t] = true;
					else v2[i] = true, v1[t] = true;
					t = -1;
				}
			}
		}
		if (c == 1)break;
	}
	while (1){
		t = -1;
		c = 0;
		for (i = 0; i < N; i++){
			if (!v2[i]){
				c++;
				r2 = i;
				if (t == -1) t = i;
				else{
					p = Compare(t, i);
					if (p == 1) v2[t] = true;
					else v2[i] = true;
					t = -1;
				}
			}
		}
		if (c == 1)break;
	}
	Answer(r1, r2);
}

Compilation message

ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:41:16: warning: 'r2' may be used uninitialized in this function [-Wmaybe-uninitialized]
  Answer(r1, r2);
                ^
ramen.cpp:41:16: warning: 'r1' may be used uninitialized in this function [-Wmaybe-uninitialized]

# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1124 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1124 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1124 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -