Submission #625714

#TimeUsernameProblemLanguageResultExecution timeMemory
625714TheLostCookiePrisoner Challenge (IOI22_prison)C++17
10 / 100
6 ms468 KiB
#include "prison.h" #include <vector> using namespace std; typedef vector<int> vi; #define FOR(i,a,b) for(int i=(a); i<(b); ++i) #define ROF(i,a,b) for(int i=(b)-1; i>=(a); --i) std::vector<std::vector<int>> devise_strategy(int N) { vector<vi> v(21, vi(N+1)); v[0][0] = 0; FOR(j,1,N+1) { if(j&(1<<9)) v[0][j] = 20; else v[0][j] = 10; } FOR(i,1,11) { v[i][0] = v[i+10][0] = 1-(i%2); FOR(j,1,N+1) { if(j&(1<<(i-1))) { v[i][j] = -1-(i%2); if(i>1) v[i+10][j] = (j&(1<<(i-2)))?(10+i-1):(i-1); else v[i+10][j] = 0; //never used } else { v[i+10][j] = -2+(i%2); if(i>1) v[i][j] = (j&(1<<(i-2)))?(10+i-1):(i-1); else v[i][j] = 0; //never used } } } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...