Submission #117474

# Submission time Handle Problem Language Result Execution time Memory
117474 2019-06-16T03:54:31 Z tjd229 라멘 (JOI14_ramen) C++14
100 / 100
2 ms 512 KB
#include "ramen.h"
int X[400], Y[400];
int XSZ, YSZ;
void Ramen(int N) {
	for (int i = 0; i < N; i += 2) {
		if (i + 1 == N) {
			X[XSZ++]=i;
			Y[YSZ++] = i;
		}
		else if (Compare(i, i + 1)>0) {
			Y[YSZ++] = i;
			X[XSZ++] = i + 1;
		}
		else {
			Y[YSZ++] = i+1;
			X[XSZ++] = i;
		}
	}
	for (int i = 1; i < XSZ; ++i) {
		if (Compare(X[0], X[i]) > 0) X[0] ^= X[i] ^= X[0] ^= X[i];
	}
	for (int i = 1; i < YSZ; ++i) {
		if (Compare(Y[0], Y[i]) < 0) Y[0] ^= Y[i] ^= Y[0] ^= Y[i];
	}
	Answer(X[0],Y[0]);
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 392 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct