# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
837775 | Baytoro | Prisoner Challenge (IOI22_prison) | C++17 | 0 ms | 212 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 "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,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-1;k++)
tmp/=3;
if(i<4){//<-
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |