제출 #96466

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
964662019-02-09 14:42:19KLPPDEL13 (info1cup18_del13)C++14
6 / 100
1082 ms2428 KiB
#include<bits/stdc++.h>
using namespace std;
int n;
bool done;
bool possible[1000000];
void DFS(int mask){
if(possible[mask])return;
possible[mask]=true;
int arr[n];
for(int i=0;i<n;i++){
arr[i]=((mask&(1<<i))>0);
}
int prev[n];
int next[n];
prev[0]=-1;
for(int i=1;i<n;i++){
if(arr[i-1]==1)prev[i]=prev[i-1];
else prev[i]=i-1;
}
next[n-1]=n;
for(int i=n-2;i>-1;i--){
if(arr[i+1]==1)next[i]=next[i+1];
else next[i]=i+1;
}
/*for(int i=0;i<n;i++){
cout<<prev[i]<<" "<<next[i]<<endl;
}*/
for(int i=0;i<n;i++){
if(arr[i]==0 && prev[i]!=-1 && next[i]!=n){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...