Submission #1120070

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11200702024-11-27 22:10:25GoodkNightPrisoner Challenge (IOI22_prison)C++17
80 / 100
8 ms1108 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...