Submission #667363

#TimeUsernameProblemLanguageResultExecution timeMemory
667363MohammadAghilGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" #pragma GCC optimize ("Ofast,unroll-loops") // #pragma GCC target ("avx2") using namespace std; typedef long long ll; typedef pair<ll, ll> pp; #define per(i,r,l) for(int i = (r); i >= (l); i--) #define rep(i,l,r) for(int i = (l); i < (r); i++) #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() #define pb push_back #define ss second #define ff first void err(istringstream *iss){}template<typename T,typename ...Args> void err(istringstream *iss,const T &_val, const Args&...args){string _name;*iss>>_name;if(_name.back()==',')_name.pop_back();cerr<<_name<<" = "<<_val<<", ",err(iss,args...);} void IOS(){ cin.tie(0) -> sync_with_stdio(0); // #ifndef ONLINE_JUDGE // #define er(args ...) cerr << __LINE__ << ": ", err(new istringstream(string(#args)), args), cerr << endl // freopen("inp.txt", "r", stdin); // freopen("out.txt", "w", stdout); // #else // #define er(args ...) 0 // #endif } mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); const ll mod = 1e9 + 9, maxn = 3e5 + 5, lg = 17, inf = ll(1e18) + 5, p = 9973; ll pw(ll a,ll b,ll md=mod){if(!b)return 1;ll k=pw(a,b>>1ll,md);return k*k%md*(b&1ll?a:1)%md;} ll a[maxn], n; // void MinMax(ll s, ll t, ll &mn, ll &mx){ // mn = mx = -1; // rep(i,0,n) { // if(a[i] >= s && a[i] <= t) { // if(mn == -1) mn = mx = a[i]; // mn = min(mn, a[i]); // mx = max(mx, a[i]); // } // } // } ll findGap(int T, int N) { ll ans = -inf; if(T == 1){ ll mn = 0, mx = inf; vector<ll> a; while(mn < mx){ MinMax(mn, mx, mn, mx); if(mn + 1){ a.pb(mn), a.pb(mx); mn++, mx--; } else break; } sort(all(a)); rep(i,1,sz(a)) ans = max(ans, a[i] - a[i-1]); } return ans; }

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:49:31: error: invalid conversion from 'll' {aka 'long long int'} to 'long long int*' [-fpermissive]
   49 |                MinMax(mn, mx, mn, mx);
      |                               ^~
      |                               |
      |                               ll {aka long long int}
In file included from gap.cpp:2:
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:49:35: error: invalid conversion from 'll' {aka 'long long int'} to 'long long int*' [-fpermissive]
   49 |                MinMax(mn, mx, mn, mx);
      |                                   ^~
      |                                   |
      |                                   ll {aka long long int}
In file included from gap.cpp:2:
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*);
      |                                               ^~~~~~~~~~