제출 #162104

#제출 시각아이디문제언어결과실행 시간메모리
162104Nordway동굴 (IOI13_cave)C++14
33 / 100
48 ms512 KiB
#include "cave.h" #include <bits/stdc++.h> #define x first #define y second #define pb push_back #define mp make_pair #define sz(v) v.size() #define all(v) v.begin(),v.end() using namespace std; typedef long long ll; typedef pair<int,int> pii; const int inf=2e9; const int N=5111; int a[N],d[N]; void exploreCave(int n){ for(int i=0;i<n;i++){ a[i]=1; d[i]=-1; } int x=tryCombination(a); while(1){ if(x==-1)break; for(int i=0;i<n;i++){ int y; if(d[i]==-1){ a[i]=0; y=tryCombination(a); if(y<x)d[i]=y; if(y>x||y==-1){ d[i]=x; x=y; break; } a[i]=1; } } } for(int i=0;i<n;i++){ if(d[i]==-1){ a[i]=0; x=tryCombination(a); d[i]=x; a[i]=1; } } answer(a,d); }
#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...