제출 #830320

#제출 시각아이디문제언어결과실행 시간메모리
8303207mody죄수들의 도전 (IOI22_prison)C++17
0 / 100
1 ms300 KiB
#include "prison.h" #include <bits/stdc++.h> using namespace std; typedef unsigned long long ll; vector<vector<int>> devise_strategy(int n) { vector<vector<int>> ans(27,vector<int>(n+1)); for(int i=1;i<=n;i++){ int curr=1; curr+=(i>>12)&1; ans[0][i]=curr; } int move=12; for(int i=1; i <=26;i++){ int curr=((i+1)/2)*2 + 1; int bag=(curr/2)%2; ans[i][0]=bag; for(int j=1; j <=n;j++){ curr=((i+1)/2)*2 + 1; if(i%2){ if(((j>>move)&1)){ if(bag) ans[i][j]=-1; else ans[i][j]=-2; } else{ curr+=((j>>(move-1))&1); ans[i][j]=curr; } } else{ if(((j>>move)&1) == 0){ if(bag) ans[i][j]=-2; else ans[i][j]=-1; } else{ curr+=((j>>(move-1))&1); ans[i][j]=curr; } } } if(bag%2==0) move--; } return ans; } // void solve(){ // int n; cin >> n; // vector<vector<int>> arr=devise_strategy(n); // for(auto c : arr){ // for(auto i : c) cout << i << ' '; // cout << endl; // } // } // int main(){ // ios::sync_with_stdio(false);cout.tie();cin.tie(); // int t=1; // // cin >> t; // while(t--){ // solve(); // } // }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...