Submission #1056273

#TimeUsernameProblemLanguageResultExecution timeMemory
1056273mychecksedadPrisoner Challenge (IOI22_prison)C++17
60 / 100
11 ms1316 KiB
#include "prison.h" #include<bits/stdc++.h> using namespace std; #define pb push_back #define all(x) x.begin(),x.end() #define ll long long int #define en cout << '\n' #define pi pair<int,int> #define vi vector<int> #define ff first #define ss second std::vector<std::vector<int>> devise_strategy(int n) { vector<vector<int>> ans(26, vector<int>(n+1, 0)); ans[0][0] = 0; for(int i = 1; i <= n; ++i){ ans[0][i] = (i&(4096)) ? 2 : 1; } int tot = 13; for(int i = 1; i <= 25; ++ i){ int bit = tot-(i+1)/2; // cout << bit << ' '; int cur; if(bit % 2 == 1){ ans[i][0] = 0; cur = 1; }else{ ans[i][0] = 1; cur = 2; } int nx = (1<<(bit-1)); for(int j = 1; j <= n; ++j){ if((j&(1<<bit))){ if(i % 2 == 1){ ans[i][j] = -(3-cur); }else{ if(j&nx){ ans[i][j] = i + 2; }else{ ans[i][j] = i + 1; } } }else{ if(i % 2 == 0){ ans[i][j] = -cur; }else{ if(j&(nx)){ ans[i][j] = i + 3; }else{ ans[i][j] = i + 2; } } } if(ans[i][j] == 26) ans[i][j] = -(3-cur); if(ans[i][j] == 27) ans[i][j] = -cur; } } // for(auto &v: ans){ // for(auto &u: v){ // if(u == 26) u = 1; // } // } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...