Submission #811177

# Submission time Handle Problem Language Result Execution time Memory
811177 2023-08-07T01:52:36 Z maomao90 Ancient Machine 2 (JOI23_ancient2) C++17
10 / 100
109 ms 696 KB
#include "ancient2.h"
#include <bits/stdc++.h>
using namespace std;

#define REP(i, j, k) for (int i = (j); i < (k); i++)
#define RREP(i, j, k) for (int i = (j); i >= (k); i--)

template <class T>
inline bool mnto(T &a, const T b) {return a > b ? a = b, 1 : 0;}
template <class T>
inline bool mxto(T &a, const T b) {return a < b ? a = b, 1 : 0;}

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
#define FI first
#define SE second
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
#define ALL(x) x.begin(), x.end()
#define SZ(x) (int) x.size()
#define pb push_back
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef tuple<int, int, int> iii;
typedef vector<iii> viii;

#ifndef DEBUG
#define cerr if (0) cerr
#endif

const int INF = 1000000005;
const ll LINF = 1000000000000000005;
const int MAXN = 500005;

namespace {
	int n;
	char findPrefix(int p) {
		int m = p + 3;
		vi a(m);
		iota(ALL(a), 1);
		a[p + 1] = p + 1;
		a[p + 2] = p + 2;
		vi b = a;
		a[p] = p + 1;
		b[p] = p + 2;
		int r = Query(m, a, b);
		return '0' + (r == p + 2);
	}
}

string Solve(int N) {
	n = N;
	string ans(n, '0');
	REP (i, 0, n) {
	//REP (i, 0, n / 2) {
		ans[i] = findPrefix(i);
	}
	/*
	string suf = "";
	RREP (i, n - 1, n / 2) {
		ans[i] = findSuffix(suf);
		suf = ans[i] + suf;
	}
	*/
	return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 96 ms 428 KB Output is partially correct
2 Partially correct 74 ms 420 KB Output is partially correct
3 Partially correct 69 ms 432 KB Output is partially correct
4 Partially correct 74 ms 424 KB Output is partially correct
5 Partially correct 75 ms 428 KB Output is partially correct
6 Partially correct 70 ms 432 KB Output is partially correct
7 Partially correct 83 ms 568 KB Output is partially correct
8 Partially correct 72 ms 432 KB Output is partially correct
9 Partially correct 78 ms 420 KB Output is partially correct
10 Partially correct 71 ms 428 KB Output is partially correct
11 Partially correct 71 ms 424 KB Output is partially correct
12 Partially correct 72 ms 428 KB Output is partially correct
13 Partially correct 73 ms 436 KB Output is partially correct
14 Partially correct 70 ms 424 KB Output is partially correct
15 Partially correct 74 ms 420 KB Output is partially correct
16 Partially correct 69 ms 440 KB Output is partially correct
17 Partially correct 71 ms 428 KB Output is partially correct
18 Partially correct 72 ms 520 KB Output is partially correct
19 Partially correct 71 ms 428 KB Output is partially correct
20 Partially correct 73 ms 432 KB Output is partially correct
21 Partially correct 73 ms 428 KB Output is partially correct
22 Partially correct 75 ms 488 KB Output is partially correct
23 Partially correct 73 ms 424 KB Output is partially correct
24 Partially correct 71 ms 428 KB Output is partially correct
25 Partially correct 70 ms 424 KB Output is partially correct
26 Partially correct 78 ms 464 KB Output is partially correct
27 Partially correct 73 ms 428 KB Output is partially correct
28 Partially correct 70 ms 424 KB Output is partially correct
29 Partially correct 76 ms 664 KB Output is partially correct
30 Partially correct 73 ms 424 KB Output is partially correct
31 Partially correct 74 ms 428 KB Output is partially correct
32 Partially correct 74 ms 424 KB Output is partially correct
33 Partially correct 72 ms 548 KB Output is partially correct
34 Partially correct 76 ms 424 KB Output is partially correct
35 Partially correct 74 ms 420 KB Output is partially correct
36 Partially correct 72 ms 436 KB Output is partially correct
37 Partially correct 73 ms 424 KB Output is partially correct
38 Partially correct 74 ms 428 KB Output is partially correct
39 Partially correct 71 ms 420 KB Output is partially correct
40 Partially correct 77 ms 428 KB Output is partially correct
41 Partially correct 91 ms 424 KB Output is partially correct
42 Partially correct 109 ms 420 KB Output is partially correct
43 Partially correct 71 ms 424 KB Output is partially correct
44 Partially correct 89 ms 552 KB Output is partially correct
45 Partially correct 72 ms 424 KB Output is partially correct
46 Partially correct 73 ms 420 KB Output is partially correct
47 Partially correct 70 ms 424 KB Output is partially correct
48 Partially correct 75 ms 456 KB Output is partially correct
49 Partially correct 73 ms 424 KB Output is partially correct
50 Partially correct 77 ms 428 KB Output is partially correct
51 Partially correct 70 ms 696 KB Output is partially correct
52 Partially correct 72 ms 428 KB Output is partially correct
53 Partially correct 77 ms 428 KB Output is partially correct
54 Partially correct 74 ms 424 KB Output is partially correct
55 Partially correct 71 ms 424 KB Output is partially correct
56 Partially correct 76 ms 432 KB Output is partially correct
57 Partially correct 83 ms 416 KB Output is partially correct
58 Partially correct 88 ms 428 KB Output is partially correct
59 Partially correct 71 ms 424 KB Output is partially correct
60 Partially correct 71 ms 424 KB Output is partially correct
61 Partially correct 106 ms 424 KB Output is partially correct
62 Partially correct 74 ms 428 KB Output is partially correct
63 Partially correct 73 ms 420 KB Output is partially correct