Submission #414060

#TimeUsernameProblemLanguageResultExecution timeMemory
414060HediChehaidarCave (IOI13_cave)C++17
Compilation error
0 ms0 KiB
/* 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]; void exploreCave(int 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[tryCombination(s)] = i; 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); int N , M , L ; int A[(int)1e5 + 10]; int B[(int)1e5 + 10]; int T[(int)1e5 + 10]; cin>>N>>M>>L; for(int i = 0 ; i < M ; i++) cin>>A[i]>>B[i]>>T[i]; cout << travelTime(N , M , L , A , B , T); 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 ! */

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:41:29: error: 'n' was not declared in this scope
   41 |         for(int i = 0 ; i < n ; i++){
      |                             ^
cave.cpp:54:25: error: 'n' was not declared in this scope
   54 |     for(int i = 0 ; i < n ; i++){
      |                         ^