Submission #463643

#TimeUsernameProblemLanguageResultExecution timeMemory
463643MohamedFaresNebiliCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; /** |||||||||||||||||||||||||||||||| SOLUTION |||||||||||||||||||||||||||||||| **/ int n, pos[5024], d[5024], arr[5024]; bitset<5024>done; int tryCombination(intS[]); void answer(intS[],intD[]); void div(int v, int l, int r, int col) { if(l==r) { done[l]=true; pos[l]=col; d[l]=v; return; } int mid=(l+r)/2; for(int i=0;i<n;i++) { if(l<=i&&mid>=i) arr[i]=col; else arr[i]=1^col; } for(int i=0;i<n;i++) if(done[i]) arr[i]=pos[i]; int a=tryCombination(arr); if(a==-1||a>v) div(v, l, mid, col); else div(v, mid+1, r, col); } int solve(int i) { for(int l=0;l<n;l++) arr[l]=0; for(int l=0;l<n;l++) if(done[l]) arr[l]=pos[l]; int a=tryCombination(arr); if(a==-1||a>i) return 0; else return 1; } void exploreCave(int N) { n=N; for(int l=0;l<n;l++) { int a=solve(l); div(l, 0, n-1, a); } answer(pos, d); }

Compilation message (stderr)

cave.cpp:10:27: warning: `\U0000037e' is not in NFC [-Wnormalized=]
   10 | int tryCombination(intS[]);
      |                           ^
cave.cpp:11:27: warning: `\U0000037e' is not in NFC [-Wnormalized=]
   11 | void answer(intS[],intD[]);
      |                           ^
cave.cpp:10:20: error: 'intS' was not declared in this scope; did you mean 'int'?
   10 | int tryCombination(intS[]);
      |                    ^~~~
      |                    int
cave.cpp:10:25: error: expected primary-expression before ']' token
   10 | int tryCombination(intS[]);
      |                         ^
cave.cpp: In function 'int solve(int)':
cave.cpp:36:29: error: 'tryCombination' cannot be used as a function
   36 |     int a=tryCombination(arr);
      |                             ^
cave.cpp: In function 'void exploreCave(int)':
cave.cpp:45:25: error: no matching function for call to 'div(int&, int, int, int&)'
   45 |         div(l, 0, n-1, a);
      |                         ^
In file included from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from cave.cpp:1:
/usr/include/stdlib.h:852:14: note: candidate: 'div_t div(int, int)'
  852 | extern div_t div (int __numer, int __denom)
      |              ^~~
/usr/include/stdlib.h:852:14: note:   candidate expects 2 arguments, 4 provided
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:47,
                 from cave.cpp:1:
/usr/include/c++/10/cstdlib:213:3: note: candidate: 'lldiv_t __gnu_cxx::div(long long int, long long int)'
  213 |   div(long long __n, long long __d)
      |   ^~~
/usr/include/c++/10/cstdlib:213:3: note:   candidate expects 2 arguments, 4 provided
/usr/include/c++/10/cstdlib:177:3: note: candidate: 'ldiv_t std::div(long int, long int)'
  177 |   div(long __i, long __j) { return ldiv(__i, __j); }
      |   ^~~
/usr/include/c++/10/cstdlib:177:3: note:   candidate expects 2 arguments, 4 provided
cave.cpp:47:5: error: 'answer' was not declared in this scope
   47 |     answer(pos, d);
      |     ^~~~~~