제출 #1186741

#제출 시각아이디문제언어결과실행 시간메모리
1186741ByeWorldPrisoner Challenge (IOI22_prison)C++20
36.50 / 100
13 ms2372 KiB
#include "prison.h" #include <bits/stdc++.h> #define ll long long #define fi first #define se second #define pb push_back using namespace std; typedef pair<ll,ll> pii; typedef pair<ll,pii> ipii; const int MAXN = 3e5+100; const ll INF = 2e18+10; const int LOG = 12; int n; vector<vector<int>> ANS; std::vector<std::vector<int>> devise_strategy(int N) { n = N; vector<int> vec; // mulai vec.pb(0); // buka a for(int i=1; i<=n; i++){ // buka A, tulis i if((i>>12) & 1) vec.pb(25 + 1); else vec.pb(24 + 1); } ANS.pb(vec); // -2 --> b lebih kecil, -1 --> a // 1-26 --> A ke B for(int j=1; j<=26; j++){ // kalo di board = j int p = j-1; int bit = p/2, ada = p%2; vector<int> tem; tem.pb(1); // open b if(ada){ // 1 for(int i=1; i<=n; i++){ if((i>>bit) & 1) tem.pb(bit + 27); // = 1 sama else tem.pb(-2); // b lebih kecil } } else { // = 0 for(int i=1; i<=n; i++){ if((i>>bit) & 1) tem.pb(-1); // a lebi kecil else tem.pb(bit + 27); // =0 juga, kasi tau bitnya } } // cout << tem.size() << "siz2\n"; ANS.pb(tem); } // 27 - 39 --> B ke A for(int j=27; j<=39; j++){ // kalo di board = j // cout << " mas\n"; int bit = j-27; // bitnya yg sblmnya vector<int> tem; tem.pb(0); // open a bit--; // if(bit==-1) assert(false); for(int i=1; i<=n; i++){ if((i>>bit) & 1) tem.pb(2*bit+1 + 1); else tem.pb(2*bit + 1); } // cout << tem.size() << "siz\n"; ANS.pb(tem); } return ANS; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...