Submission #99793

#TimeUsernameProblemLanguageResultExecution timeMemory
99793MohamedAhmed0Cave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std ; const int MAX = 5005 ; int s[MAX] , d[MAX] , arr[MAX] , last , done[MAX]; int now ; bool check(int l , int mid) { for(int i = l ; i <= mid ; ++i) { if(done[i]) continue ; s[i] = !s[i] ; } int x = tryCombination(s) '' for(int i = l ; i <= mid ; ++i) { if(done[i]) continue; s[i] = !s[i] ; } if(x > now || x == -1) { last = x ; return 1 ; } return 0 ; } void exploreCave(int N) { memset(s , 0 , sizeof(s)); for(int i = 0 ; i < N ; ++i) { now = i ; if(last > i) { for(int j = 0 ; j < N ; ++j) { if(done[j]) continue; s[j] = !s[j] ; } } int l = 0 , r = N-1 , ans = N-1; while(l <= r) { int mid = (l + r) / 2 ; if(check(l , mid)) ans = mid , r = mid-1 ; else l = mid+1 ; } d[i] = ans ; done[ans] = 1 ; s[ans] = !s[ans] ; } answer(s , d) ; }

Compilation message (stderr)

cave.cpp:18:35: error: empty character constant
         int x = tryCombination(s) ''
                                   ^~
cave.cpp: In function 'bool check(int, int)':
cave.cpp:18:35: error: expected ',' or ';' before '\x0'
cave.cpp:19:25: error: 'i' was not declared in this scope
         for(int i = l ; i <= mid ; ++i)
                         ^