제출 #450395

#제출 시각아이디문제언어결과실행 시간메모리
450395MohamedAliSaidane동굴 (IOI13_cave)C++14
0 / 100
226 ms432 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; #define pb push_back #define popb pop_back #define ff first #define ss second const int MOD = 1e9 + 7; const int MAX_N = 5004; bool visited[MAX_N]; void exploreCave(int n) { int comb[n]; memset(comb,0,sizeof(comb)); int first = tryCombination(comb); int ass[n]; memset(ass,0,sizeof(ass)); int state[n]; memset(state,0,sizeof(state)); int cnt = 0; while(cnt < n) { for(int i = 0; i < n ; i ++) { if(visited[i]) continue; comb[i] = 1 - comb[i]; int ess = tryCombination(comb); if(ess != -1 && ess < first) { comb[i] = 1 - comb[i]; ass[i] = ess; state[i] = comb[i]; visited[i] = true; cnt ++; } else if(ess > first) { ass[i] = first; state[i] = comb[i]; visited[i] = true; first = ess; cnt ++; } } } answer(state,ass); 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...