제출 #626801

#제출 시각아이디문제언어결과실행 시간메모리
626801whynotshadow죄수들의 도전 (IOI22_prison)C++17
56 / 100
12 ms1188 KiB
#include "prison.h" #include <bits/stdc++.h> //#include <cassert> //#include <cstdio> // //#include <string> //#include <vector> using namespace std; typedef int ll; //const ll N=1e6+9; ll a,b,c,d,a1,b1,c1,val,i,sum1,j,n,m,pos,ans,sum,cur,res,ans1,res1; ll k,kk,kkk,cnt,cnt1,l,r,x,y,mn,t,fl,q,bit; vector<vector<int>> devise_strategy(int N) { vector<vector<ll>>v(27,vector<ll>(N+1)); v[0][0]=0; for(ll i=1;i<=N;i++){ v[0][i]=13*(1+(i>>12&1)); } for(ll i=1; i<=26; i++){ if(i<=13) bit=i-1,val=0; else bit=i-14,val=1; v[i][0]=(bit+1)&1; for(ll j=1;j<=N;j++){ res=(j>>bit&1); if(res==val){ v[i][j]=bit+13*(j>>(bit-1)&1); } else{ if(res==0 && val==1) v[i][j]=-(v[i][0]+1); else{ if(v[i][0]==0) v[i][j]=-2; else v[i][j]=-1; } } } } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...