Submission #125367

# Submission time Handle Problem Language Result Execution time Memory
125367 2019-07-05T07:04:31 Z 구재현(#3066) Park (JOI17_park) C++14
27 / 100
684 ms 1072 KB
#include "park.h"
#include <bits/stdc++.h>
using namespace std;

bool ask(int s, int e, vector<int> v){
	if(s > e) swap(s, e);
	int Place[1400] = {};
	v.push_back(s); v.push_back(e);
	for(auto &i : v) Place[i] = 1;
	return Ask(s, e, Place);
}

void dfs(int r, vector<int> v){
	if(v.size() == 1) return;
	vector<int> adj;
	int j = -1;
	for(auto &i : v){
		if(i == r) continue;
		if(ask(i, r, {})){		
			j = i;
			break;
		}
	}
	vector<int> noj = v;
	noj.erase(find(noj.begin(), noj.end(), j));
	vector<int> ls, rs;
	for(auto &i : v){
		if(i == r || i == j) continue;
		if(ask(r, i, noj) == 1) ls.push_back(i);
		else rs.push_back(i);
	}
	Answer(min(r, j), max(r, j));
	ls.push_back(r);
	rs.push_back(j);
	dfs(r, ls);
	dfs(j, rs);
}

void Detect(int T, int N) {
	srand(69696969);
	vector<int> v(N);
	iota(v.begin(), v.end(), 0);
	dfs(0, v);
}
# 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 508 ms 932 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 146 ms 732 KB Output is correct
2 Correct 144 ms 504 KB Output is correct
3 Correct 123 ms 584 KB Output is correct
4 Correct 72 ms 648 KB Output is correct
5 Correct 110 ms 568 KB Output is correct
6 Correct 116 ms 640 KB Output is correct
7 Correct 83 ms 540 KB Output is correct
8 Correct 95 ms 632 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 143 ms 652 KB Output is correct
2 Incorrect 436 ms 892 KB Wrong Answer[5]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 684 ms 1072 KB Wrong Answer[5]
2 Halted 0 ms 0 KB -