제출 #628101

#제출 시각아이디문제언어결과실행 시간메모리
628101jwvg0425죄수들의 도전 (IOI22_prison)C++17
30 / 100
25 ms1712 KiB
#include <stdio.h> #include <vector> #include <queue> #include <algorithm> #include <iostream> #include <string> #include <bitset> #include <map> #include <set> #include <tuple> #include <string.h> #include <math.h> #include <random> #include <functional> #include <assert.h> #include <math.h> #define all(x) (x).begin(), (x).end() #define xx first #define yy second using namespace std; template<typename T, typename Pr = less<T>> using pq = priority_queue<T, vector<T>, Pr>; using i64 = long long int; using ii = pair<int, int>; using ii64 = pair<i64, i64>; vector<vector<int>> devise_strategy(int N) { const int BIT_SIZE = 13; vector<vector<int>> res(BIT_SIZE * 3 + 3, vector<int>(N + 1, 0)); for (int num = 0; num <= BIT_SIZE; num++) { int bit = (1 << (BIT_SIZE - num)); res[num][0] = 0; for (int a = 1; a <= N; a++) { if ((a & bit) != 0) res[num][a] = BIT_SIZE + 1 + num * 2 + 1; else res[num][a] = BIT_SIZE + 1 + num * 2; } } for (int num = BIT_SIZE + 1; num < BIT_SIZE * 3 + 3; num++) { res[num][0] = 1; int ahas = num % 2; int bit = 1 << (BIT_SIZE - (num - BIT_SIZE - 1) / 2); for (int b = 1; b <= N; b++) { int bhas = (b & bit) != 0 ? 1 : 0; if (ahas == bhas) res[num][b] = (num - BIT_SIZE - 1) / 2 + 1; else if (ahas > bhas) res[num][b] = -2; else res[num][b] = -1; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...