Submission #538274

#TimeUsernameProblemLanguageResultExecution timeMemory
538274status_codingGap (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 == 1) { vector<long long> l, r; long long st=0, dr=1e18; while(st <= dr) { MinMax(st, dr, &st, &dr); if(st == -1) break; if(st == dr) { l.push_back(st); break; } l.push_back(st); r.push_back(dr); st++; dr--; } while(!r.empty()) { l.push_back(r.back()); r.pop_back(); } /* for(long long it : l) cout<<it<<' '; cout<<'\n'; */ if((int)l.size != n) exit(2); long long ans=0; for(int i=1;i<n;i++) ans=max(ans, l[i] - l[i-1]); return ans; } else { if(n == 4) return 3; exit(1); } }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:44:19: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]' (did you forget the '()' ?)
   44 |         if((int)l.size != n)
      |                 ~~^~~~
      |                       ()