# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
49810 |
2018-06-03T09:38:38 Z |
hamzqq9 |
Gap (APIO16_gap) |
C++14 |
|
84 ms |
39644 KB |
#include "gap.h"
#include<bits/stdc++.h>
#define lf double
#define ll long long
#define cc pair<char,char>
#define ull unsigned ll
#define ii pair<int,int>
#define li pair<ll,int>
#define iii pair<int,ii>
#define iiii pair<ii,ii>
#define iiii2 pair<int,iii>
#define lii pair<ll,ii>
#define lolo pair<ll,ll>
#define heap priority_queue
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define all(x) x.begin(),x.end()
#define len(x) strlen(x)
#define sz(x) (int) x.size()
#define orta ((bas+son)/2)
#define min3(x,y,z) min(min(x,y),z)
#define max3(x,y,z) max(max(x,y),z)
#define umin(x,y) x=min(x,y)
#define umax(x,y) x=max(x,y)
#define dbgs(x) cerr<<(#x)<<" --> "<<(x)<<" "
#define dbg(x) cerr<<(#x)<<" --> "<<(x)<<endl;getchar()
#define MOD 998244353
#define inf 100000000000000000
#define M 10000002
#define LOG 40
#define magic 100
#define KOK 250
#define EPS 0.0025
#define pw(x) ((1ll)<<(x))
#define PI 3.1415926535
using namespace std;
long long findGap(int T, int N) {
ll ans=-1;
ll bas,son;
MinMax(0,inf,&bas,&son);
ll ratio=(son-bas)/(N-1);
vector<ll> possible;
possible.pb(bas);
for(int i=1;i<N;i++) {
ll v1,v2;
MinMax(bas+ratio*(i-1)+1,bas+ratio*i,&v1,&v2);
if(v1!=-1) {
if(v1!=v2 || (sz(possible) && possible.back()!=v1)) possible.pb(v1);
possible.pb(v2);
}
}
if(possible.back()!=son) possible.pb(son);
for(int i=0;i<sz(possible)-1;i++) {
umax(ans,possible[i+1]-possible[i]);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
376 KB |
Execution failed because the return code was nonzero |
2 |
Incorrect |
3 ms |
480 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
536 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
636 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
684 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
712 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
712 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
716 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
808 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
812 KB |
Output isn't correct |
11 |
Incorrect |
3 ms |
860 KB |
Output isn't correct |
12 |
Incorrect |
5 ms |
860 KB |
Output isn't correct |
13 |
Incorrect |
6 ms |
892 KB |
Output isn't correct |
14 |
Incorrect |
3 ms |
920 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
1080 KB |
Output isn't correct |
16 |
Incorrect |
14 ms |
1764 KB |
Output isn't correct |
17 |
Incorrect |
15 ms |
2244 KB |
Output isn't correct |
18 |
Incorrect |
14 ms |
2640 KB |
Output isn't correct |
19 |
Incorrect |
14 ms |
3176 KB |
Output isn't correct |
20 |
Incorrect |
10 ms |
3252 KB |
Output isn't correct |
21 |
Incorrect |
55 ms |
6016 KB |
Output isn't correct |
22 |
Incorrect |
62 ms |
7944 KB |
Output isn't correct |
23 |
Incorrect |
56 ms |
9716 KB |
Output isn't correct |
24 |
Incorrect |
55 ms |
11556 KB |
Output isn't correct |
25 |
Incorrect |
76 ms |
14608 KB |
Output isn't correct |
26 |
Incorrect |
55 ms |
14672 KB |
Output isn't correct |
27 |
Incorrect |
55 ms |
16572 KB |
Output isn't correct |
28 |
Incorrect |
84 ms |
18348 KB |
Output isn't correct |
29 |
Incorrect |
52 ms |
20180 KB |
Output isn't correct |
30 |
Incorrect |
40 ms |
20744 KB |
Output isn't correct |
31 |
Incorrect |
2 ms |
20744 KB |
Output isn't correct |
32 |
Runtime error |
3 ms |
20744 KB |
Execution failed because the return code was nonzero |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
20744 KB |
Execution failed because the return code was nonzero |
2 |
Incorrect |
2 ms |
20744 KB |
Output isn't correct |
3 |
Runtime error |
2 ms |
20744 KB |
Execution failed because the return code was nonzero |
4 |
Incorrect |
2 ms |
20744 KB |
Output isn't correct |
5 |
Correct |
9 ms |
20744 KB |
Output is correct |
6 |
Incorrect |
4 ms |
20744 KB |
Output isn't correct |
7 |
Incorrect |
3 ms |
20744 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
20744 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
20744 KB |
Output isn't correct |
10 |
Correct |
5 ms |
20744 KB |
Output is correct |
11 |
Incorrect |
3 ms |
20744 KB |
Output isn't correct |
12 |
Incorrect |
4 ms |
20744 KB |
Output isn't correct |
13 |
Incorrect |
3 ms |
20744 KB |
Output isn't correct |
14 |
Incorrect |
4 ms |
20744 KB |
Output isn't correct |
15 |
Correct |
4 ms |
20744 KB |
Output is correct |
16 |
Incorrect |
20 ms |
20744 KB |
Output isn't correct |
17 |
Incorrect |
15 ms |
21176 KB |
Output isn't correct |
18 |
Incorrect |
19 ms |
21568 KB |
Output isn't correct |
19 |
Incorrect |
15 ms |
22104 KB |
Output isn't correct |
20 |
Incorrect |
10 ms |
22104 KB |
Output isn't correct |
21 |
Incorrect |
82 ms |
24976 KB |
Output isn't correct |
22 |
Incorrect |
52 ms |
26800 KB |
Output isn't correct |
23 |
Incorrect |
53 ms |
28672 KB |
Output isn't correct |
24 |
Incorrect |
54 ms |
30524 KB |
Output isn't correct |
25 |
Correct |
75 ms |
33572 KB |
Output is correct |
26 |
Incorrect |
67 ms |
33572 KB |
Output isn't correct |
27 |
Incorrect |
51 ms |
35340 KB |
Output isn't correct |
28 |
Incorrect |
51 ms |
37272 KB |
Output isn't correct |
29 |
Incorrect |
55 ms |
39120 KB |
Output isn't correct |
30 |
Incorrect |
45 ms |
39644 KB |
Output isn't correct |
31 |
Incorrect |
2 ms |
39644 KB |
Output isn't correct |
32 |
Runtime error |
4 ms |
39644 KB |
Execution failed because the return code was nonzero |