제출 #206916

#제출 시각아이디문제언어결과실행 시간메모리
206916vardan__02동굴 (IOI13_cave)C++14
25 / 100
51 ms496 KiB
#include <algorithm> #include <iostream> #include <fstream> #include <cstring> #include <string> #include <vector> #include <cstdio> #include <queue> #include <deque> #include <stack> #include <list> #include <set> #include <map> #include "cave.h" using namespace std; typedef long long ll; #define MP make_pair #define PB push_back void get_d(int S[], int ss) { int*d = new int[ss]; for(int i=0;i<ss;i++) { S[i]=(S[i]+1)%2; int x=tryCombination(S); d[i]=x; S[i]=(S[i]+1)%2; } answer(S,d); delete[]d; } void exploreCave(int N) { int n = N, x = 0, y = 0; int i=0; int*s = new int[n]{}; while(i<=n-2) { x=tryCombination(s); if(x==-1) { get_d(s,n); delete[]s; return; } s[i+1]=(s[i+1]+1)%2; y=tryCombination(s); if(y==-1) { get_d(s,n); delete[]s; return; } if(x==y) s[i]=(s[i]+1)%2; i++; } x=tryCombination(s); if(x!=-1) s[n-1]=(s[n-1]+1)%2; get_d(s,n); delete[]s; return; }
#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...