This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
ID: hedichehaidar
TASK: photo
LANG: C++11
*/
#include<bits/stdc++.h>
#include"cave.h"
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double db;
ll gcd(ll a , ll b) {return b ? gcd(b , a % b) : a ;} // greatest common divisor (PGCD)
ll lcm(ll a , ll b) {return (a * b) / gcd(a , b);} // least common multiple (PPCM)
#define ss second
#define ff first
#define all(x) (x).begin() , (x).end()
#define pb push_back
#define vi vector<int>
#define vii vector<pair<int,int>>
#define vl vector<ll>
#define vll vector<pair<ll,ll>>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vdd vector<pdd>
#define dte tuple<double , double , double>
using namespace std;
const int INF = 1000*1000*1000; // 1 e 9
const int MOD = INF + 7;
const double EPS = 0.000000001; // 1 e -9
const ll inf = (ll)1e18;
bool ok[5050];
int n;
/*int tryCombination(int s[]){
return 0;
}
void answer(int s[] , int d[]){
return;
}*/
void exploreCave(int N){
n = N;
int s[N] , d[N];
memset(s , 0 , sizeof s);
memset(d , -1 , sizeof d);
int ans = tryCombination(s);
while(ans != -1){
for(int i = 0 ; i < N ; i++){
if(!ok[i]){
s[i] = 1 - s[i];
int cur = tryCombination(s);
if(cur != ans){
ok[i] = true;
ans = cur;
break;
}
s[i] = 1 - s[i];
}
}
}
for(int i = 0 ; i < n ; i++){
s[i] = 1 - s[i];
d[i] = tryCombination(s);
s[i] = 1 - s[i];
}
answer(s , d);
}
/*int main() {
//ifstream fin ("race.in");
//ofstream fout ("race.out");
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
return 0;
}*/
/*
12
8
2
0 8 4
8 2 2
2 7 4
5 11 3
5 1 7
1 3 1
1 9 5
10 6 3
*/
/*
16
14
5
0 1 1
0 6 4
0 7 3
7 8 6
1 2 6
2 3 5
3 4 4
3 5 5
9 10 2
9 11 3
9 12 5
9 13 1
13 14 1
14 15 10
*/
/*
Think of : BS / DFS / BFS / SSSP / SCC / MSP / MAX FLOW / TOPSORT / LCA / MATRIX / DP(bitmask) / 2 POINTERS / SEG TREE / MATH / UN FIND / MO
Read the statement CAREFULLY !!
Make a GREADY APPROACH !!!! (start from highest / lowest)
Make your own TESTS !!
Be careful from CORNER CASES !
*/
# | 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... |