Submission #837777

#TimeUsernameProblemLanguageResultExecution timeMemory
837777BaytoroPrisoner Challenge (IOI22_prison)C++17
0 / 100
1 ms336 KiB
#include "prison.h" #include <bits/stdc++.h> //#include "grader.cpp" using namespace std; #define ll long long #define sc second #define fr first #define pb push_back vector<vector<int>> devise_strategy(int n) { vector<vector<int>> a(23,vector<int>(n+1,0)); for(int i=1;i<=n;i++){ int tmp=i; for(int j=0;j<7;j++) tmp/=3; a[0][i]=19+tmp%3; } for(int i=1;i+1<(int)a.size();i++){ if(((i-1)/3)%2==0){ a[i][0]=1; for(int j=1;j<=n;j++){ int tmp=j; for(int k=0;k<=(i-1)/3;k++) tmp/=3; if(tmp%3>(i-1)%3) a[i][j]=-1; else if(tmp%3<(i-1)%3) a[i][j]=-2; else{ int tmp=j; for(int k=0;k<(i-1)/3;k++) tmp/=3; if((i-1)/3==0){//<- if(tmp%3==0) a[i][j]=-2; else if(tmp%3==2) a[i][j]=-3; else a[i][j]=22; } else{ a[i][j]=((i-1)/3-1)*3+tmp%3+1; } } } } else{ a[i][0]=1; for(int j=1;j<=n;j++){ int tmp=j; for(int k=0;k<=(i-1)/3;k++) tmp/=3;//<- if(tmp%3>(i-1)%3) a[i][j]=-2; else if(tmp%3<(i-1)%3) a[i][j]=-1; else{ int tmp=j; for(int k=0;k<(i-1)/3;k++) tmp/=3; a[i][j]=((i-1)/3-1)*3+tmp%3+1; } } } } for(int i=1;i<=n;i++){ if(i%3==0) a[22][i]=-1; else if(i%3==2) a[22][i]=-2; } return a; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...