Submission #814841

# Submission time Handle Problem Language Result Execution time Memory
814841 2023-08-08T10:29:31 Z tranxuanbach Ancient Machine 2 (JOI23_ancient2) C++17
10 / 100
202 ms 424 KB
#include "ancient2.h"

#include <bits/stdc++.h>
using namespace std;

namespace {
	int n;
	string ans;
}

string Solve(int _n){
	n = _n;
	ans = string(n, '?');
	array <int, 2> cnt;
	for (int i = 0; i < n; i++){
		vector <int> a(n + 2), b(n + 2);
		for (int j = 0; j < i; j++){
			a[j] = b[j] = j + 1;
		}
		a[i] = n;
		b[i] = n + 1;
		a[n] = b[n] = n;
		a[n + 1] = b[n + 1] = n + 1;
		if (Query(n + 2, a, b) == n){
			ans[i] = '0';
		}
		else{
			ans[i] = '1';
		}
	}
	return ans;
}

Compilation message

ancient2.cpp: In function 'std::string Solve(int)':
ancient2.cpp:14:17: warning: unused variable 'cnt' [-Wunused-variable]
   14 |  array <int, 2> cnt;
      |                 ^~~
# Verdict Execution time Memory Grader output
1 Partially correct 146 ms 316 KB Output is partially correct
2 Partially correct 149 ms 308 KB Output is partially correct
3 Partially correct 144 ms 300 KB Output is partially correct
4 Partially correct 135 ms 316 KB Output is partially correct
5 Partially correct 150 ms 420 KB Output is partially correct
6 Partially correct 134 ms 316 KB Output is partially correct
7 Partially correct 147 ms 316 KB Output is partially correct
8 Partially correct 131 ms 316 KB Output is partially correct
9 Partially correct 152 ms 316 KB Output is partially correct
10 Partially correct 137 ms 396 KB Output is partially correct
11 Partially correct 137 ms 312 KB Output is partially correct
12 Partially correct 144 ms 316 KB Output is partially correct
13 Partially correct 175 ms 312 KB Output is partially correct
14 Partially correct 143 ms 320 KB Output is partially correct
15 Partially correct 158 ms 328 KB Output is partially correct
16 Partially correct 152 ms 320 KB Output is partially correct
17 Partially correct 158 ms 424 KB Output is partially correct
18 Partially correct 157 ms 312 KB Output is partially correct
19 Partially correct 144 ms 376 KB Output is partially correct
20 Partially correct 141 ms 320 KB Output is partially correct
21 Partially correct 162 ms 316 KB Output is partially correct
22 Partially correct 159 ms 416 KB Output is partially correct
23 Partially correct 164 ms 312 KB Output is partially correct
24 Partially correct 156 ms 292 KB Output is partially correct
25 Partially correct 143 ms 312 KB Output is partially correct
26 Partially correct 185 ms 304 KB Output is partially correct
27 Partially correct 151 ms 316 KB Output is partially correct
28 Partially correct 202 ms 312 KB Output is partially correct
29 Partially correct 157 ms 312 KB Output is partially correct
30 Partially correct 170 ms 312 KB Output is partially correct
31 Partially correct 152 ms 316 KB Output is partially correct
32 Partially correct 171 ms 388 KB Output is partially correct
33 Partially correct 153 ms 312 KB Output is partially correct
34 Partially correct 161 ms 320 KB Output is partially correct
35 Partially correct 163 ms 420 KB Output is partially correct
36 Partially correct 147 ms 316 KB Output is partially correct
37 Partially correct 152 ms 320 KB Output is partially correct
38 Partially correct 158 ms 300 KB Output is partially correct
39 Partially correct 174 ms 312 KB Output is partially correct
40 Partially correct 157 ms 308 KB Output is partially correct
41 Partially correct 150 ms 316 KB Output is partially correct
42 Partially correct 173 ms 312 KB Output is partially correct
43 Partially correct 152 ms 412 KB Output is partially correct
44 Partially correct 154 ms 384 KB Output is partially correct
45 Partially correct 183 ms 312 KB Output is partially correct
46 Partially correct 157 ms 412 KB Output is partially correct
47 Partially correct 141 ms 320 KB Output is partially correct
48 Partially correct 133 ms 316 KB Output is partially correct
49 Partially correct 190 ms 400 KB Output is partially correct
50 Partially correct 141 ms 320 KB Output is partially correct
51 Partially correct 142 ms 296 KB Output is partially correct
52 Partially correct 164 ms 312 KB Output is partially correct
53 Partially correct 145 ms 400 KB Output is partially correct
54 Partially correct 177 ms 316 KB Output is partially correct
55 Partially correct 132 ms 424 KB Output is partially correct
56 Partially correct 139 ms 312 KB Output is partially correct
57 Partially correct 162 ms 320 KB Output is partially correct
58 Partially correct 144 ms 416 KB Output is partially correct
59 Partially correct 173 ms 316 KB Output is partially correct
60 Partially correct 144 ms 324 KB Output is partially correct
61 Partially correct 143 ms 316 KB Output is partially correct
62 Partially correct 151 ms 316 KB Output is partially correct
63 Partially correct 143 ms 316 KB Output is partially correct