Submission #376712

# Submission time Handle Problem Language Result Execution time Memory
376712 2021-03-12T02:26:33 Z casperwang Minerals (JOI19_minerals) C++14
0 / 100
31 ms 364 KB
#include "minerals.h"
#include <bits/stdc++.h>
#define All(x) x.begin(), x.end()
#define pb emplace_back
using namespace std;

vector <bool> vis;

void Solve(int N) {
	srand(time(NULL));
	vis.resize(N*2+1);
	int cnt = 0;
	for (int i = 1; i <= 2*N; i++) {
		if (vis[i]) continue;
		Query(i);
		vector <int> num;
		for (int j = 2*N; j >= N+1; j--) {
			if (vis[j]) continue;
			num.pb(j);
		}
		random_shuffle(All(num));
		for (int j : num) {
			int v = Query(j);
			if (v == cnt+1) {
				Answer(i, j);
				vis[i] = vis[j] = true;
				cnt++;
				break;
			} else {
				Query(j);
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 18 ms 364 KB Output is correct
2 Incorrect 31 ms 364 KB Wrong Answer [2]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -