Submission #826750

# Submission time Handle Problem Language Result Execution time Memory
826750 2023-08-16T02:01:25 Z jamezzz Ancient Machine 2 (JOI23_ancient2) C++17
10 / 100
30 ms 452 KB
#include "ancient2.h"
#include <bits/stdc++.h>
using namespace std;

#define pf printf
#define pb push_back
#define sz(x) ((int)x.size())

string Solve(int N){
	int know=0;
	string ans="";
	while(know!=N){
		vector<int> a,b;
		for(int i=0;i<know;++i){
			a.pb(i+1);
			b.pb(i+1);
		}
		int cur=know,num=1;
		while(cur+3*num<=1002&&know!=N){
			int ptr=cur+num;
			for(int i=cur;i<cur+num;++i){
				a.pb(ptr++);
				b.pb(ptr++);
			}
			cur=cur+num;
			num*=2;
			++know;
		}
		for(int i=cur;i<cur+num;++i){
			a.pb(i),b.pb(i);
		}
		//pf("%d:\n",sz(a));
		//for(int i:a)pf("%d ",i);pf("\n");
		//for(int i:b)pf("%d ",i);pf("\n");
		int res=Query(sz(a),a,b);
		res-=cur;
		vector<char> v;
		while(num!=1){
			v.pb((res&1)+'0');
			res>>=1;
			num>>=1;
		}
		while(!v.empty()){
			ans.pb(v.back());
			//pf("add %c\n",v.back());
			v.pop_back();
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 19 ms 412 KB Output is partially correct
2 Partially correct 18 ms 324 KB Output is partially correct
3 Partially correct 20 ms 320 KB Output is partially correct
4 Partially correct 19 ms 324 KB Output is partially correct
5 Partially correct 20 ms 432 KB Output is partially correct
6 Partially correct 21 ms 316 KB Output is partially correct
7 Partially correct 19 ms 316 KB Output is partially correct
8 Partially correct 19 ms 328 KB Output is partially correct
9 Partially correct 19 ms 324 KB Output is partially correct
10 Partially correct 18 ms 320 KB Output is partially correct
11 Partially correct 19 ms 320 KB Output is partially correct
12 Partially correct 25 ms 316 KB Output is partially correct
13 Partially correct 24 ms 320 KB Output is partially correct
14 Partially correct 20 ms 324 KB Output is partially correct
15 Partially correct 19 ms 324 KB Output is partially correct
16 Partially correct 25 ms 208 KB Output is partially correct
17 Partially correct 23 ms 452 KB Output is partially correct
18 Partially correct 27 ms 208 KB Output is partially correct
19 Partially correct 21 ms 320 KB Output is partially correct
20 Partially correct 24 ms 324 KB Output is partially correct
21 Partially correct 21 ms 324 KB Output is partially correct
22 Partially correct 19 ms 320 KB Output is partially correct
23 Partially correct 18 ms 320 KB Output is partially correct
24 Partially correct 18 ms 208 KB Output is partially correct
25 Partially correct 20 ms 336 KB Output is partially correct
26 Partially correct 21 ms 324 KB Output is partially correct
27 Partially correct 19 ms 324 KB Output is partially correct
28 Partially correct 25 ms 316 KB Output is partially correct
29 Partially correct 28 ms 316 KB Output is partially correct
30 Partially correct 19 ms 444 KB Output is partially correct
31 Partially correct 19 ms 316 KB Output is partially correct
32 Partially correct 26 ms 320 KB Output is partially correct
33 Partially correct 20 ms 324 KB Output is partially correct
34 Partially correct 29 ms 208 KB Output is partially correct
35 Partially correct 21 ms 324 KB Output is partially correct
36 Partially correct 19 ms 316 KB Output is partially correct
37 Partially correct 25 ms 320 KB Output is partially correct
38 Partially correct 19 ms 324 KB Output is partially correct
39 Partially correct 19 ms 324 KB Output is partially correct
40 Partially correct 19 ms 324 KB Output is partially correct
41 Partially correct 20 ms 440 KB Output is partially correct
42 Partially correct 18 ms 320 KB Output is partially correct
43 Partially correct 26 ms 320 KB Output is partially correct
44 Partially correct 19 ms 320 KB Output is partially correct
45 Partially correct 30 ms 316 KB Output is partially correct
46 Partially correct 19 ms 324 KB Output is partially correct
47 Partially correct 29 ms 304 KB Output is partially correct
48 Partially correct 23 ms 324 KB Output is partially correct
49 Partially correct 19 ms 316 KB Output is partially correct
50 Partially correct 25 ms 316 KB Output is partially correct
51 Partially correct 19 ms 316 KB Output is partially correct
52 Partially correct 19 ms 320 KB Output is partially correct
53 Partially correct 18 ms 208 KB Output is partially correct
54 Partially correct 18 ms 316 KB Output is partially correct
55 Partially correct 19 ms 320 KB Output is partially correct
56 Partially correct 19 ms 320 KB Output is partially correct
57 Partially correct 19 ms 320 KB Output is partially correct
58 Partially correct 28 ms 320 KB Output is partially correct
59 Partially correct 23 ms 416 KB Output is partially correct
60 Partially correct 18 ms 208 KB Output is partially correct
61 Partially correct 19 ms 324 KB Output is partially correct
62 Partially correct 21 ms 320 KB Output is partially correct
63 Partially correct 19 ms 316 KB Output is partially correct