Submission #240373

#TimeUsernameProblemLanguageResultExecution timeMemory
240373Dremix10Gap (APIO16_gap)C++17
0 / 100
70 ms2392 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; #define F first #define S second #define endl '\n' #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define maxp 22 #define EPS (ld)(1e-18) #define mod (int)(1e9+7) //#define N (int)(1e5+1) long long findGap(int T, int N){ int i; vector<ll> arr; ll limit=(N+1)/2; ll l=1,r=1e18+1; while(arr.size()<N){ ll mini,maxi; ll* p1 = &mini; ll* p2 = &maxi; MinMax(l,r,p1,p2); arr.push_back(mini); arr.push_back(maxi); l=mini+1; r=maxi-1; } sort(arr.begin(),arr.end()); ll ans=0; for(i=0;i<N-1;i++) ans=max(ans,arr[i+1]-arr[i]); return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:26:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(arr.size()<N){
           ~~~~~~~~~~^~
gap.cpp:22:8: warning: unused variable 'limit' [-Wunused-variable]
     ll limit=(N+1)/2;
        ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...