Submission #939803

# Submission time Handle Problem Language Result Execution time Memory
939803 2024-03-06T19:04:18 Z AdamGS Lockpicking (IOI23_lockpicking) C++17
100 / 100
6 ms 3192 KB
#include "lockpicking.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void construct_card(int N, vector<int>A, vector<vector<int>>S) {
  vector<int>B=A;
  vector<vector<int>>T=S;
  int k=1;
  vector<int>odw(N);
  for(int i=1; i<N; ++i) {
    int p=i, s=0;
    int ile=0;
    while(p!=s%N && ile<N) {
      ++ile;
      if(A[p]!=B[s] && !odw[s]) {
        rep(j, N) {
          B.pb(A[j]);
          T.pb({S[j][0]+k*N, S[j][1]+k*N});
          odw.pb(0);
        }
        T[s][A[p]]=S[p][B[s]]%N+k*N;
        ++k;
        odw[s]=1;
      }
      int x=A[p], y=B[s];
      p=S[p][y];
      s=T[s][x];
      if(x!=y) ile=0;
    }
  }
  define_states(N*k, B, T, 0);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
2 Correct 0 ms 348 KB ok, most errors: 0 (allowed: 1)
3 Correct 0 ms 348 KB ok, most errors: 0 (allowed: 1)
4 Correct 1 ms 348 KB ok, most errors: 1 (allowed: 1)
5 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
6 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
7 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
8 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
9 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
10 Correct 0 ms 344 KB ok, most errors: 1 (allowed: 1)
11 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
12 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok, most errors: 3 (allowed: 29)
2 Correct 1 ms 348 KB ok, most errors: 5 (allowed: 29)
3 Correct 1 ms 348 KB ok, most errors: 4 (allowed: 29)
4 Correct 1 ms 604 KB ok, most errors: 4 (allowed: 29)
5 Correct 1 ms 348 KB ok, most errors: 4 (allowed: 29)
6 Correct 1 ms 348 KB ok, most errors: 3 (allowed: 29)
7 Correct 1 ms 348 KB ok, most errors: 4 (allowed: 29)
8 Correct 1 ms 348 KB ok, most errors: 5 (allowed: 29)
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok, most errors: 3 (allowed: 899)
2 Correct 1 ms 348 KB ok, most errors: 3 (allowed: 899)
3 Correct 1 ms 348 KB ok, most errors: 4 (allowed: 899)
4 Correct 1 ms 436 KB ok, most errors: 4 (allowed: 899)
5 Correct 1 ms 348 KB ok, most errors: 4 (allowed: 899)
6 Correct 1 ms 348 KB ok, most errors: 6 (allowed: 899)
7 Correct 1 ms 348 KB ok, most errors: 4 (allowed: 899)
8 Correct 1 ms 600 KB ok, most errors: 4 (allowed: 899)
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
2 Correct 0 ms 348 KB ok, most errors: 0 (allowed: 1)
3 Correct 0 ms 348 KB ok, most errors: 0 (allowed: 1)
4 Correct 1 ms 348 KB ok, most errors: 1 (allowed: 1)
5 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
6 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
7 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
8 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
9 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
10 Correct 0 ms 344 KB ok, most errors: 1 (allowed: 1)
11 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
12 Correct 0 ms 348 KB ok, most errors: 1 (allowed: 1)
13 Correct 0 ms 348 KB ok, most errors: 3 (allowed: 29)
14 Correct 1 ms 348 KB ok, most errors: 5 (allowed: 29)
15 Correct 1 ms 348 KB ok, most errors: 4 (allowed: 29)
16 Correct 1 ms 604 KB ok, most errors: 4 (allowed: 29)
17 Correct 1 ms 348 KB ok, most errors: 4 (allowed: 29)
18 Correct 1 ms 348 KB ok, most errors: 3 (allowed: 29)
19 Correct 1 ms 348 KB ok, most errors: 4 (allowed: 29)
20 Correct 1 ms 348 KB ok, most errors: 5 (allowed: 29)
21 Correct 1 ms 604 KB ok, most errors: 6 (allowed: 127)
22 Correct 1 ms 860 KB ok, most errors: 7 (allowed: 149)
23 Correct 3 ms 1628 KB ok, most errors: 5 (allowed: 149)
24 Correct 2 ms 860 KB ok, most errors: 7 (allowed: 149)
25 Correct 5 ms 2936 KB ok, most errors: 6 (allowed: 149)
26 Correct 6 ms 3192 KB ok, most errors: 8 (allowed: 149)
27 Correct 5 ms 2680 KB ok, most errors: 6 (allowed: 149)
28 Correct 5 ms 2936 KB ok, most errors: 7 (allowed: 149)
29 Correct 5 ms 2936 KB ok, most errors: 6 (allowed: 149)
30 Correct 5 ms 2936 KB ok, most errors: 7 (allowed: 149)
31 Correct 6 ms 3016 KB ok, most errors: 8 (allowed: 149)
32 Correct 5 ms 2936 KB ok, most errors: 7 (allowed: 149)