제출 #966181

#제출 시각아이디문제언어결과실행 시간메모리
96618142kangaroo죄수들의 도전 (IOI22_prison)C++17
0 / 100
6 ms600 KiB
#include "prison.h" #include <vector> std::vector<std::vector<int>> devise_strategy(int N) { using namespace std; vector<vector<int>> strat(25, vector<int>(N + 1, 0)); strat[0][0] = 0; for (int i = 0; i < N; ++i) { strat[0][i + 1] = ((i + 1) >> 11) + 1; } strat[1][0] = strat[2][0] = strat[3][0] = 1; for (int i = 1; i < 4; ++i) { for (int j = 0; j < N; ++j) { if ((j + 1) >> 11 == i - 1) { strat[i][j + 1] = 4 + (((j + 1) >> 10) % 2); } else if ((j + 1) >> 11 > i - 1) strat[i][j + 1] = -2; else strat[i][j + 1] = -1; } } for (int i = 0 ; i < 10; ++i) { strat[4+ 2*i][0] = strat[5 + 2*i][0] = i % 2; for (int j = 0; j < N; ++j) { if (((j + 1) >> (11 - i)) % 2 == 0) { strat[5 + 2*i][j + 1] = -1 - (i)%2; strat[4 + 2*i][j + 1] = 6 + 2*i + ((j + 1) >> (10 - i)) % 2; } else { strat[4 + 2*i][j + 1] = -1 - (i + 1)%2; strat[5 + 2*i][j + 1] = 6 + 2*i + ((j + 1) >> (10 - i)) % 2; } } } strat[22][0] = strat[23][0] = 1; for (int i = 0; i < N; ++i) { if (((i + 1) >> 2) % 2 == 0) { strat[23][i + 1] = -2; if (i%4 == 0) { strat[22][i + 1] = -2; } else if (i%4 == 2) { strat[22][i + 1] = -1; } else { strat[22][i + 1] = 24; } } else { strat[22][i + 1] = -2; if (i%4 == 0) { strat[23][i + 1] = -2; } else if (i%4 == 2) { strat[23][i + 1] = -1; } else { strat[23][i + 1] = 24; } } } strat[24][0] = 0; for (int i = 0; i < N; ++i) { if (i%4 == 2) { strat[24][i + 1] = -2; } else { strat[24][i + 1] = -1; } } return strat; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...