Submission #284832

#TimeUsernameProblemLanguageResultExecution timeMemory
284832triplem5dsGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include "bits/stdc++.h" using namespace std; long long findGap(int T, int N) { if(T == 2){ long long cur = 0; vector<long long > vr; long long ans = 0; for(int i = 0; i < N; i++){ long long mn, mx; MinMax(cur, cur, mn, mx); vr.push_back(mn); cur = mn + 1; if(i)ans = max(ans, vr[i] - vr[i-1]); } } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:12:24: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   12 |       MinMax(cur, cur, mn, mx);
      |                        ^~
      |                        |
      |                        long long int
In file included from gap.cpp:1:
gap.h:1:35: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                   ^~~~~~~~~~
gap.cpp:12:28: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   12 |       MinMax(cur, cur, mn, mx);
      |                            ^~
      |                            |
      |                            long long int
In file included from gap.cpp:1:
gap.h:1:47: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                               ^~~~~~~~~~
gap.cpp:18:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |   return ans;
      |          ^~~
      |          abs