Submission #125336

# Submission time Handle Problem Language Result Execution time Memory
125336 2019-07-05T05:52:40 Z 임유진(#3061) Park (JOI17_park) C++14
10 / 100
171 ms 504 KB
#include "park.h"
#include<algorithm>

using namespace std;

static int place[1400];
static int N;
static int ans[1400];

bool cmp(int a, int b) {
	place[a] = 0;
	int t = Ask(0, b, place);
	place[a] = 1;
	return t == 0;
}

void answer(int a, int b) {
	Answer(min(a, b), max(a, b));
}

void Detect(int T, int N) {
	if(T != 2) return;
	for(int i = 0; i < N; i++) place[i] = 1;
	for(int i = 1; i < N - 1; i++) ans[i - 1] = i;
	sort(ans, ans + N - 2, cmp);
	//for(int i = 0; i < N - 2; i++) printf("%d ", ans[i]);
	for(int i = 0; i < N - 3; i++) answer(ans[i], ans[i + 1]);
	answer(0, ans[0]);
	answer(N - 1, ans[N - 3]);
}

Compilation message

park.cpp:7:12: warning: 'N' defined but not used [-Wunused-variable]
 static int N;
            ^
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 163 ms 376 KB Output is correct
2 Correct 103 ms 504 KB Output is correct
3 Correct 132 ms 504 KB Output is correct
4 Correct 166 ms 492 KB Output is correct
5 Correct 171 ms 504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Wrong Answer[6]
2 Halted 0 ms 0 KB -