Submission #626113

#TimeUsernameProblemLanguageResultExecution timeMemory
626113Black_GhostPrisoner Challenge (IOI22_prison)C++17
38 / 100
24 ms1612 KiB
#include "prison.h" #include <bits/stdc++.h> #include <vector> #define pb push_back using namespace std; std::vector<std::vector<int>> devise_strategy(int N) { int n=N; std::vector<std::vector<int>> v; vector<int> newv; // 0 1-9 int ran=13; newv.pb(0); /*1-9 1000 2000 4000 10-18 19-26*/ for(int i=1;i<=n;i++){ int s=pow(2,ran-1); if((s&i)) newv.pb(ran); else newv.pb(ran*2); //cout<<s; } v.pb(newv); newv.clear(); for(int k=1;k<=ran;k++){ newv.pb(1); for(int i=1;i<=n;i++){ int y=pow(2,k-1); if((y&i)) newv.pb(ran*2+k-1); else newv.pb(-2); } v.pb(newv); newv.clear(); } for(int k=ran+1;k<=ran*2;k++){ newv.pb(1); for(int i=1;i<=n;i++){ int y=pow(2,k-ran-1); if((y&i)) newv.pb(-1); else newv.pb(ran*2+k-ran-1); } v.pb(newv); newv.clear(); } for(int k=ran*2+1;k<=ran*3-1;k++){ newv.pb(0); for(int i=1;i<=n;i++){ int y=pow(2,k-ran*2-1); if((y&i)) newv.pb(k-ran*2); else newv.pb(k-ran); } v.pb(newv); newv.clear(); } return v; } /* 8 8 16 8 8 16 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...