Submission #187331

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1873312020-01-12 17:43:24rzbtGap (APIO16_gap)C++14
30 / 100
2095 ms1272 KiB
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define MAXN 100005
#include "gap.h"
typedef long long ll;
using namespace std;
ll findGap(int t,int n){
if(t==1){ll res=0;
ll l,d,tl,td;
MinMax(0ll,1000000000000000000ll,&l,&d);
while(n>2){
MinMax(l+1,d-1,&tl,&td);
//printf(" %lld %lld %lld %lld\n",l,d,tl,td);
res=max(res,max(tl-l,d-td));
l=tl;
d=td;
n-=2;
}
if(n==2)res=max(res,d-l);
return res;
}
ll l,d,res=0;
MinMax(0ll,1000000000000000000ll,&l,&d);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:32:15: warning: unused variable 'kolko' [-Wunused-variable]
     ll tl=l+1,kolko,a,b;
               ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...