Submission #683014

#TimeUsernameProblemLanguageResultExecution timeMemory
683014thegamercoder19Cave (IOI13_cave)C++14
33 / 100
46 ms356 KiB
#include "cave.h" #define _CRT_SECURE_NO_WARNINGS #include <bits/stdc++.h> #define M_PI 3.14159265358979323846 #define FILER 0 using ll = long long; using ull = unsigned long long; using ld = long double; const ll MOD = pow(10, 9) + 7; const ll INFL = 0x3f3f3f3f3f3f3f3f; const ull INFUL = 0x3f3f3f3f3f3f3f3f; const ll INFT = 0x3f3f3f3f; const ull MAX = 1LL << 24; const ll MODD = 998244353; const double EPS = 1e-10; #define V vector #define pll pair<ll, ll> #define pull2 pair<ull,ull> #define MS multiset #define M map #define Q queue #define PQ priority_queue #define IOF ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define FOR(typ,i,a,b,c) for(typ i = a; i < b; i += c) #define FORR(typ,i,a,b,c) for(typ i = a; i > b; i -= c) #define FORA(a,i) for(auto &i : a) #define all(v) v.begin(),v.end() #define sz(v) v.size() #define sorta(a) sort(all(a)) #define sortd(a) sort(all(a), greater<ll>()) #define setp(x) setprecision(x)<<fixed #define RET return #define log(a,b) log(b)/log(a) #define WH(s) while(s) #define WHI(t) WH(t--) #define YES cout<<"YES"<<endl; #define NO cout<<"NO"<<endl; #define Yes cout<<"Yes"<<endl; #define No cout<<"No"<<endl; #define YESNO(s) cout << (s ? "YES" : "NO") << endl; #define YesNo(s) cout<<(s?"Yes":"No")<<endl; #define TYP 0 using namespace std; V<ll> a; void exploreCave(int N) { V<int> s, d; V<bool> isc; d.resize(N); s.resize(N, 1); isc.resize(N); ll i = 0, j = 0, j1 = 0; WH(1) { j = tryCombination(&s[0]); if (j == -1)break; FOR(ll, k, 0, N, 1) { if (!isc[k]) { s[k] ^= 1; if ((j1 = tryCombination(&s[0])) > j || j1 == -1) { isc[k] = 1; break; } if (j1 < j)isc[k] = 1; s[k] ^= 1; } } } i = 0, j = 0, j1 = 0; WH(i < N) { s[i] ^= 1; j = tryCombination(&s[0]); d[i] = j; s[i] ^= 1; i++; } answer(&s[0], &d[0]); }
#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...