Submission #965276

# Submission time Handle Problem Language Result Execution time Memory
965276 2024-04-18T09:17:41 Z willychan Ancient Machine 2 (JOI23_ancient2) C++17
22 / 100
73 ms 1628 KB
#include "ancient2.h"
#include<bits/stdc++.h>
using namespace std;
namespace {

int variable_example = 1;

}  // namespace

std::string Solve(int N) {
	int B = (2*N)/3;
	string ans="";
	for(int i=1;i<B;i++){
		int m = i+2;
		vector<int> a(m);
		vector<int> b(m);
		for(int j=0;j<i-1;j++){
			a[j]=j+1;
			b[j]=j+1;
		}
		a[i-1] = i;
		b[i-1] = i+1;
		a[i]=i;
		b[i]=i;
		a[i+1]=i+1;
		b[i+1]=i+1;
		int k = Query(m,a,b);
		if(k==i) ans.push_back('0');
		else ans.push_back('1');
	}
	//20
	//01001001110100100111
	//01001001110100001111
	for(int i=B;i<=N;i++){
		int k = N-i+1;
		int m = 2*k;	
		vector<int> a(m);
		vector<int> b(m);
		for(int i=0;i<k;i++){
			a[i] = (i+1)%k;
			b[i] = (i+1)%k;
			a[i+k] = k+(i+1)%k;
			b[i+k] = k+(i+1)%k;
		}
		int f = N%k;
		b[f] = k;
		a[m-1] = (f+1)%k;
		int A = Query(m,a,b);
		if(A<k) ans.push_back('0');
		else ans.push_back('1');
	}
	return ans;
}

Compilation message

ancient2.cpp:6:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    6 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Partially correct 48 ms 784 KB Output is partially correct
2 Partially correct 51 ms 1348 KB Output is partially correct
3 Partially correct 52 ms 812 KB Output is partially correct
4 Partially correct 47 ms 892 KB Output is partially correct
5 Partially correct 49 ms 1188 KB Output is partially correct
6 Partially correct 60 ms 1624 KB Output is partially correct
7 Partially correct 49 ms 1232 KB Output is partially correct
8 Partially correct 56 ms 1492 KB Output is partially correct
9 Partially correct 49 ms 1296 KB Output is partially correct
10 Partially correct 54 ms 992 KB Output is partially correct
11 Partially correct 48 ms 1324 KB Output is partially correct
12 Partially correct 53 ms 1024 KB Output is partially correct
13 Partially correct 52 ms 1484 KB Output is partially correct
14 Partially correct 52 ms 1248 KB Output is partially correct
15 Partially correct 54 ms 812 KB Output is partially correct
16 Partially correct 59 ms 1064 KB Output is partially correct
17 Partially correct 48 ms 1400 KB Output is partially correct
18 Partially correct 48 ms 1060 KB Output is partially correct
19 Partially correct 52 ms 1148 KB Output is partially correct
20 Partially correct 50 ms 836 KB Output is partially correct
21 Partially correct 54 ms 1216 KB Output is partially correct
22 Partially correct 51 ms 1096 KB Output is partially correct
23 Partially correct 47 ms 1312 KB Output is partially correct
24 Partially correct 52 ms 1308 KB Output is partially correct
25 Partially correct 52 ms 1056 KB Output is partially correct
26 Partially correct 56 ms 1024 KB Output is partially correct
27 Partially correct 52 ms 1280 KB Output is partially correct
28 Partially correct 49 ms 900 KB Output is partially correct
29 Partially correct 52 ms 1112 KB Output is partially correct
30 Partially correct 52 ms 1344 KB Output is partially correct
31 Partially correct 73 ms 1032 KB Output is partially correct
32 Partially correct 62 ms 1020 KB Output is partially correct
33 Partially correct 47 ms 1156 KB Output is partially correct
34 Partially correct 52 ms 1300 KB Output is partially correct
35 Partially correct 50 ms 1512 KB Output is partially correct
36 Partially correct 52 ms 1304 KB Output is partially correct
37 Partially correct 47 ms 836 KB Output is partially correct
38 Partially correct 49 ms 1096 KB Output is partially correct
39 Partially correct 55 ms 816 KB Output is partially correct
40 Partially correct 53 ms 880 KB Output is partially correct
41 Partially correct 48 ms 792 KB Output is partially correct
42 Partially correct 52 ms 1316 KB Output is partially correct
43 Partially correct 54 ms 1392 KB Output is partially correct
44 Partially correct 55 ms 696 KB Output is partially correct
45 Partially correct 49 ms 1052 KB Output is partially correct
46 Partially correct 52 ms 1168 KB Output is partially correct
47 Partially correct 53 ms 1028 KB Output is partially correct
48 Partially correct 52 ms 1480 KB Output is partially correct
49 Partially correct 58 ms 1016 KB Output is partially correct
50 Partially correct 52 ms 1056 KB Output is partially correct
51 Partially correct 56 ms 1040 KB Output is partially correct
52 Partially correct 57 ms 1604 KB Output is partially correct
53 Partially correct 53 ms 984 KB Output is partially correct
54 Partially correct 60 ms 1288 KB Output is partially correct
55 Partially correct 58 ms 1264 KB Output is partially correct
56 Partially correct 51 ms 1188 KB Output is partially correct
57 Partially correct 53 ms 964 KB Output is partially correct
58 Partially correct 53 ms 832 KB Output is partially correct
59 Partially correct 51 ms 820 KB Output is partially correct
60 Partially correct 56 ms 1064 KB Output is partially correct
61 Partially correct 68 ms 1292 KB Output is partially correct
62 Partially correct 54 ms 1628 KB Output is partially correct
63 Partially correct 51 ms 1056 KB Output is partially correct