This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#define F first
#define S second
#define rep(i,a,b) for(int i=a;!(a==b&&i!=b)&&((i<=b&&b>=a)||(i>=b&&a>=b));i+=(a<=b?1:-1))
#define pb push_back
#define Fbitl __builtin_ffs
#define bit1 __builtin_popcount
//#include <bits/stdc++.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string.h>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include "cave.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
void exploreCave(int N) {
int com[N] , ans2[N] ;
for(int i=0;i<N;i++) {
com[i] = 0;
}
int c = 0 , a = 0 , mxa = 0 ;
while ( true ) {
a = tryCombination(com);
if ( a == -1 ) break;
mxa = max(a,mxa);
a = mxa ;
for ( int i = 0 ; i < N ; i++) {
if ( com[i] ) continue;
com[i] = 1 ;
int b = tryCombination(com) ;
if ( b > a || b == -1 ) {
a = (b==-1?(int)1e5:b) ;
}
else com[i] = 0 ;
}
}
for ( int i = 0 ; i < N ; i++) {
com[i] = (com[i]+1) % 2 ;
ans2[i] = tryCombination(com);
com[i] = (com[i]+1) % 2 ;
}
answer(com,ans2);
}
Compilation message (stderr)
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:32:9: warning: unused variable 'c' [-Wunused-variable]
32 | int c = 0 , a = 0 , mxa = 0 ;
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |