제출 #979751

#제출 시각아이디문제언어결과실행 시간메모리
979751sleepntsheep죄수들의 도전 (IOI22_prison)C++17
47 / 100
19 ms1528 KiB
#include "prison.h" //#include<cstdio> #include <vector> std::vector<std::vector<int>> devise_strategy(int N) { int X = 32; std::vector<std::vector<int> > s(X+1, std::vector<int>(N+1)); /* * compare */ auto get = [&](int x, int i) { while(i--) x/=3; return x%3; }; for(int read=0;read<=X;++read) { auto write = [&](int j,int x) { s[read][j] = x; }; int at=(read)/4; int dd=(read)%4; if(dd>0) { write(0, 1); --dd; for(int i=1;i<=N;++i) { int ee=get(i,at); if(ee==dd) write(i, (at>0) ? (at)*4: -1); else write(i, ee>dd?-1:-2); } } else { write(0,0); for(int i=1;i<=N;++i) { int to = at ? at - 1 : 7; write(i, to*4+1+get(i,to)); } } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...