제출 #1037484

#제출 시각아이디문제언어결과실행 시간메모리
1037484HappyCapybara죄수들의 도전 (IOI22_prison)C++17
0 / 100
0 ms348 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; vector<vector<int>> devise_strategy(int N){ int y = ceil(log2(N)); vector<vector<int>> a(3*y, vector<int>(N+1)); for (int i=0; i<3*y; i++){ for (int j=0; j<N+1; j++){ if (i % 3 == 0){ if (j == 0){ a[i][j] = 0; continue; } a[i][j] = i+1+min(1, (j&(1<<(y-1-i/3)))); } else { if (j == 0){ a[i][j] = 1; continue; } int b = 1+min(1, j&(1<<(y-1-i/3))); if (b == i % 3) a[i][j] = (i+(3-i%3))%(3*y); else { if (b > i % 3) a[i][j] = -1; else a[i][j] = -2; } } } } return a; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...