Submission #274738

#TimeUsernameProblemLanguageResultExecution timeMemory
274738test2Gap (APIO16_gap)C++14
0 / 100
84 ms5880 KiB
#include<bits/stdc++.h> #include "gap.h" //#pragma GCC optimize("Ofast") //#pragma GCC target("avx,avx2,fma") //#pragma GCC optimization ("unroll-loops") #define I inline void using ll = long long ; using ld = long double ; using namespace std ; const int mod = 1e9 + 7 ; // how interesting! int n; vector<ll> v ; ll zero1 = -1 ; ll zero2 = -1 ; long long findGap(int T, int N) { ll st = 0 , en = 1e18 ; ll *mn , *mx ; ll lo = 0, hi = 1e18 ; mn = &zero1; mx = &zero2; set<ll> s ; while(lo <= hi){ MinMax(lo , hi , mn , mx) ; s.insert( *mn ) ; s.insert( *mx ) ; if( (*mn) == (*mx) ){ break ; } lo = (*mn) + 1; hi = (*mx) - 1; } ll ans = 0 ; ll l = 0 ; for(auto u : s){ if(l){ ans = max(ans , u - l) ; } l = u ; } return ans ; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:28:5: warning: unused variable 'st' [-Wunused-variable]
   28 |  ll st = 0 , en = 1e18 ;
      |     ^~
gap.cpp:28:14: warning: unused variable 'en' [-Wunused-variable]
   28 |  ll st = 0 , en = 1e18 ;
      |              ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...