제출 #824947

#제출 시각아이디문제언어결과실행 시간메모리
824947alvingogo죄수들의 도전 (IOI22_prison)C++17
65 / 100
13 ms1620 KiB
#include "prison.h" #include <bits/stdc++.h> #define fs first #define sc second #define p_q priority_queue using namespace std; int n; vector<vector<int> > ans; vector<vector<int>> devise_strategy(int N) { n=N; vector<int> s(n+1); s[0]=0; int m=4096; for(int i=1;i<=n;i++){ if(i<m){ s[i]=1; } else{ s[i]=2; } } ans.push_back(s); int fl=1; int q=3; for(;m>1;m>>=1){ vector<int> x[2]={vector<int>(n+1),vector<int>(n+1)}; x[0][0]=x[1][0]=fl; for(int i=1;i<=n;i++){ if(i%(2*m)>=m){ x[0][i]=fl-2; if(m==2){ x[1][i]=(i%m==0)?(-1-fl):(fl-2); } else{ x[1][i]=q+((i%m)>=(m/2)); } } else{ if(m==2){ x[0][i]=(i%m==0)?(-1-fl):(fl-2); } else{ x[0][i]=q+((i%m)>=(m/2)); } x[1][i]=-1-fl; } } ans.push_back(x[0]); ans.push_back(x[1]); fl^=1; q+=2; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...