Submission #376708

# Submission time Handle Problem Language Result Execution time Memory
376708 2021-03-12T02:19:31 Z casperwang Minerals (JOI19_minerals) C++14
6 / 100
7 ms 364 KB
#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;

vector <bool> vis;

void Solve(int N) {
	vis.resize(N*2+1);
	int cnt = 0;
	for (int i = 1; i <= 2*N; i++) {
		if (vis[i]) continue;
		Query(i);
		for (int j = i+1; j <= 2*N; j++) {
			if (vis[j]) continue;
			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 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 364 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Incorrect 7 ms 364 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Incorrect 7 ms 364 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Incorrect 7 ms 364 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Incorrect 7 ms 364 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Incorrect 7 ms 364 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Incorrect 7 ms 364 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Incorrect 7 ms 364 KB Wrong Answer [2]
6 Halted 0 ms 0 KB -