Submission #810967

# Submission time Handle Problem Language Result Execution time Memory
810967 2023-08-06T18:42:35 Z taher Ancient Machine 2 (JOI23_ancient2) C++17
10 / 100
182 ms 540 KB
#include "ancient2.h"
 
#include <bits/stdc++.h>
 
using namespace std;
 
string Solve(int N) {
  string s;
 
  const int M = 1002;
  vector<int> a(M);
  vector<int> b(M);
  a[0] = 1;
  a[1] = 1;
  b[1] = 1;
 
  b[0] = 2;
  b[2] = 2;
  a[2] = 2;
 
  for (int i = 0; i < N - 1; i++) {
    int ret = Query(M, a, b);
 
    if (ret == i + 1) {
      s += '0';
      a[i] = i + 1;
    } else {
      s += '1';
      b[i] = i + 1;
    }
 
    a[i + 1] = i + 2;
    a[i + 2] = i + 2;
    b[i + 2] = i + 2;
 
    b[i + 1] = i + 3;
    b[i + 3] = i + 3;
    a[i + 3] = i + 3;
  }

  a.assign(M, 0);
  b.assign(M, 1);
  int ret = Query(M, a, b);
  s += (ret + '0');
  return s;
}
# Verdict Execution time Memory Grader output
1 Partially correct 135 ms 320 KB Output is partially correct
2 Partially correct 142 ms 296 KB Output is partially correct
3 Partially correct 136 ms 320 KB Output is partially correct
4 Partially correct 147 ms 336 KB Output is partially correct
5 Partially correct 136 ms 324 KB Output is partially correct
6 Partially correct 158 ms 316 KB Output is partially correct
7 Partially correct 134 ms 324 KB Output is partially correct
8 Partially correct 137 ms 316 KB Output is partially correct
9 Partially correct 139 ms 500 KB Output is partially correct
10 Partially correct 134 ms 308 KB Output is partially correct
11 Partially correct 136 ms 320 KB Output is partially correct
12 Partially correct 139 ms 324 KB Output is partially correct
13 Partially correct 136 ms 320 KB Output is partially correct
14 Partially correct 139 ms 316 KB Output is partially correct
15 Partially correct 142 ms 300 KB Output is partially correct
16 Partially correct 153 ms 324 KB Output is partially correct
17 Partially correct 139 ms 324 KB Output is partially correct
18 Partially correct 138 ms 324 KB Output is partially correct
19 Partially correct 142 ms 400 KB Output is partially correct
20 Partially correct 134 ms 320 KB Output is partially correct
21 Partially correct 154 ms 340 KB Output is partially correct
22 Partially correct 149 ms 316 KB Output is partially correct
23 Partially correct 140 ms 320 KB Output is partially correct
24 Partially correct 138 ms 336 KB Output is partially correct
25 Partially correct 135 ms 316 KB Output is partially correct
26 Partially correct 156 ms 456 KB Output is partially correct
27 Partially correct 158 ms 320 KB Output is partially correct
28 Partially correct 139 ms 356 KB Output is partially correct
29 Partially correct 139 ms 316 KB Output is partially correct
30 Partially correct 140 ms 320 KB Output is partially correct
31 Partially correct 139 ms 320 KB Output is partially correct
32 Partially correct 135 ms 320 KB Output is partially correct
33 Partially correct 138 ms 324 KB Output is partially correct
34 Partially correct 148 ms 320 KB Output is partially correct
35 Partially correct 135 ms 316 KB Output is partially correct
36 Partially correct 146 ms 460 KB Output is partially correct
37 Partially correct 171 ms 312 KB Output is partially correct
38 Partially correct 152 ms 540 KB Output is partially correct
39 Partially correct 135 ms 336 KB Output is partially correct
40 Partially correct 134 ms 488 KB Output is partially correct
41 Partially correct 140 ms 320 KB Output is partially correct
42 Partially correct 135 ms 316 KB Output is partially correct
43 Partially correct 138 ms 324 KB Output is partially correct
44 Partially correct 135 ms 320 KB Output is partially correct
45 Partially correct 139 ms 316 KB Output is partially correct
46 Partially correct 182 ms 392 KB Output is partially correct
47 Partially correct 135 ms 324 KB Output is partially correct
48 Partially correct 144 ms 416 KB Output is partially correct
49 Partially correct 139 ms 320 KB Output is partially correct
50 Partially correct 139 ms 428 KB Output is partially correct
51 Partially correct 135 ms 316 KB Output is partially correct
52 Partially correct 135 ms 324 KB Output is partially correct
53 Partially correct 148 ms 364 KB Output is partially correct
54 Partially correct 143 ms 320 KB Output is partially correct
55 Partially correct 140 ms 328 KB Output is partially correct
56 Partially correct 135 ms 316 KB Output is partially correct
57 Partially correct 138 ms 300 KB Output is partially correct
58 Partially correct 138 ms 316 KB Output is partially correct
59 Partially correct 137 ms 316 KB Output is partially correct
60 Partially correct 137 ms 384 KB Output is partially correct
61 Partially correct 139 ms 320 KB Output is partially correct
62 Partially correct 141 ms 316 KB Output is partially correct
63 Partially correct 139 ms 304 KB Output is partially correct