# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120070 | GoodkNight | Prisoner Challenge (IOI22_prison) | C++17 | 8 ms | 1108 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int x=23;
int pot[10];
vector<vector<int>> devise_strategy(int n){
pot[0]=1;
for(int i=1; i<10; i++) pot[i] = pot[i-1]*3;
vector<vector<int>> w;
w.resize(x);
for(int i=0; i<x; i++) w[i].resize(n+1);
for(int i=0; i<x; i++){
if(i%6==0||i%6==4||i%6==5) w[i][0] = 0;
else w[i][0] = 1;
}
for(int j=0; j<n; j++){
w[0][j+1] = j/pot[7] + 1;
}
for(int i=1; i<x-4; i++){
int ktora = (i+2)/3;
int mod = (i+2)%3;
int po = 8-ktora;
for(int j=0; j<n; j++){
int cyfra = (j/(pot[po]))%3;
if(cyfra < mod){
if(w[i][0]==1) w[i][j+1]=-2;
else w[i][j+1]=-1;
}
if(cyfra > mod){
if(w[i][0]==1) w[i][j+1]=-1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |