Submission #536193

#TimeUsernameProblemLanguageResultExecution timeMemory
536193DJ035Gap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include "gap.h" #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2") #include <bits/stdc++.h> #define MEM 111111 #define sanic ios_base::sync_with_stdio(0) #define x first #define y second #define pf push_front #define pb push_back #define all(v) v.begin(), v.end() #define sz size() using namespace std; typedef long long ll; typedef pair<ll, ll> pi; const ll INF = 1e17+7; const ll MOD = 998244353; ll gcd(ll a, ll b){ if(a%b) return gcd(b, a%b); return b; } ll t,n,m; ll a[MEM]; ll findGap(int T, int N) { if(T==1){ ll l=0, r=1e18, s=0, e=N-1; for(int i=0; i<(N+1)/2; i++){ MinMax(l, r, &l, &r); a[s] = l; a[e] = r; l++, r--; s++, e--; } ll ans=0; for(int i=0; i<N-1; i++) ans = max(ans, a[i+1]-a[i]); return ans; } else{ ll mn, mx; MinMax(0,1e18,&mn,&mx); ll sz=(mx-mn+N-1)/N; ll ans=0, tp=mn; for(int i=0; i<N; i++){ ll s=mn+i*sz+1, e=mn+(i+1)*sz; ll gmx, gmn; MinMax(s,e,&gmn,&gmx); if(gmn==-1) continue; ans = max(ans, gmn-tp); tp = gmx; } return ans; } }

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:14:17: warning: declaration of 'll size()' has 'extern' and is initialized
   14 | #define sz size()
      |                 ^
gap.cpp:45:12: note: in expansion of macro 'sz'
   45 |         ll sz=(mx-mn+N-1)/N;
      |            ^~
gap.cpp:45:16: error: invalid pure specifier (only '= 0' is allowed) before 'mx'
   45 |         ll sz=(mx-mn+N-1)/N;
      |                ^~
gap.cpp:14:12: error: function 'll size()' is initialized like a variable
   14 | #define sz size()
      |            ^~~~
gap.cpp:45:12: note: in expansion of macro 'sz'
   45 |         ll sz=(mx-mn+N-1)/N;
      |            ^~