Submission #553348

#TimeUsernameProblemLanguageResultExecution timeMemory
553348uroskGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" // __builtin_popcount(x) // __builtin_popcountll(x) #define here cerr<<"===========================================\n" #include <bits/stdc++.h> #define ld double #define ll long long #define ull unsigned long long #define llinf 100000000000000000LL // 10^17 #define iinf 2000000000 // 2*10^9 #define pb push_back #define popb pop_back #define fi first #define sc second #define endl '\n' #define pii pair<int,int> #define pll pair<ll,ll> #define pld pair<ld,ld> #define sz(a) int(a.size()) #define all(a) a.begin(),a.end() #define ceri(a,l,r) {for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;} using namespace std; ll n; ll findGap(ll T, ll N) { n = N; if(t==1){ ll l = 1,r = 1000000000; r*=r; vector<ll> v; while(l<=r){ ll x,y; MinMax(l,r,x,y); if(x==-1&&y==-1) break; if(x==y){ v.pb(x); break; }else{ v.pb(x); v.pb(y); r = y-1; l = x+1; } } sort(all(v)); ll ans = 0; for(ll i = 0;i<sz(v)-1;i++){ ans = max(ans,v[i+1]-v[i]); } return ans; } return 0; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:27:8: error: 't' was not declared in this scope
   27 |     if(t==1){
      |        ^
gap.cpp:33:24: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   33 |             MinMax(l,r,x,y);
      |                        ^
      |                        |
      |                        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:33:26: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   33 |             MinMax(l,r,x,y);
      |                          ^
      |                          |
      |                          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*);
      |                                               ^~~~~~~~~~