Submission #144907

#TimeUsernameProblemLanguageResultExecution timeMemory
144907youssefbou62Cave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "cave.h" using namespace std; #define mp make_pair #define fi first #define se second #define all(v) v.begin(),v.end() #define allarr(a) a , a + n #define ll long long #define ull unsigned long long #define pb push_back #define fastio ios_base::sync_with_stdio(false) ; cin.tie(NULL); cout.tie(NULL) typedef pair<int, int> pi; typedef pair<ll,ll> pll; typedef pair<int,pi> trp ; typedef vector<pi> vpi; typedef vector<pll> vpll ; // int ab (int x ) { return (x>0?x:-x); } int n ,reply; int cnt = 0 ; int door[5005],Comb[5005]; int TryCombination(int S[]){ cnt++; return tryCombination(S); } void rev(int l , int r ){ for(int i = l ; i <= r ; i++ )if( door[i]==-1)Comb[i]=!Comb[i]; } void exploreCave(int N){ n = N ; memset(door,-1,sizeof door); memeset(Comb,0,sizeof Comb); for(int T = 0 ; T < N ; T++ ){ int FI = tryCombination(Comb); reply = FI ; if( reply == -1 )break ; int l = 0 , r =N-1 ; while ( l < r ){ int mid = (l+r)/2; rev(l,mid); reply = tryCombination(Comb); rev(tryCombination); if( reply == FI )l = mid ; else r = mid ; } assert(reply == -1 || l == r ); if( l == r )door[l]=reply; } for(int i = 0 ; i < n ; i++ )if( door[i]==-1 ){ rev(i,i); reply = tryCombination(Comb); rev(i,i); dooor[i]=tryCombination(Comb); } answer(Combination); }

Compilation message (stderr)

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:38:6: error: 'memeset' was not declared in this scope
      memeset(Comb,0,sizeof Comb); 
      ^~~~~~~
cave.cpp:38:6: note: suggested alternative: 'memset'
      memeset(Comb,0,sizeof Comb); 
      ^~~~~~~
      memset
cave.cpp:51:26: error: invalid conversion from 'int (*)(int*)' to 'int' [-fpermissive]
        rev(tryCombination); 
                          ^
cave.cpp:51:26: error: too few arguments to function 'void rev(int, int)'
cave.cpp:31:10: note: declared here
     void rev(int l , int r ){
          ^~~
cave.cpp:63:7: error: 'dooor' was not declared in this scope
       dooor[i]=tryCombination(Comb); 
       ^~~~~
cave.cpp:63:7: note: suggested alternative: 'door'
       dooor[i]=tryCombination(Comb); 
       ^~~~~
       door
cave.cpp:65:13: error: 'Combination' was not declared in this scope
      answer(Combination); 
             ^~~~~~~~~~~
cave.cpp:65:13: note: suggested alternative: 'TryCombination'
      answer(Combination); 
             ^~~~~~~~~~~
             TryCombination