# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
109322 |
2019-05-06T06:59:18 Z |
b2563125 |
Gap (APIO16_gap) |
C++14 |
|
67 ms |
1188 KB |
#include<iostream>
#include<algorithm>
#include<vector>
#include "gap.h"
using namespace std;
#define vel vector<long long>
#define ll long long
#define rep(i,n) for(long long i=0;i<n;i++)
int pr = 1000000007;
int ref(int &a) {
a = a % pr;
a += pr;
a = a % pr;
return a;
}
long long findGap(int t, int n) {
long long N = n;
long long a1; long long an;
long long INF = pr - 7;
INF *= INF;
MinMax(0, INF, &a1, &an);
long long X = an - a1 + 1;
long long now_min = a1;
long long ans = 0;
rep(i, n) {
long long mn, mx;
ll j = i;
j++;
MinMax(a1 + (X*i) / N,a1 + (X*j) / N, &mn, &mx);
if (mn != -1) {
ans = max(mn - now_min, ans);
now_min = mx;
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
3 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
4 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
5 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
6 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
7 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
8 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
9 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
10 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
11 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
12 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
13 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
14 |
Runtime error |
4 ms |
384 KB |
Execution failed because the return code was nonzero |
15 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
16 |
Runtime error |
8 ms |
512 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
9 ms |
512 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
8 ms |
512 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
13 ms |
512 KB |
Execution failed because the return code was nonzero |
20 |
Incorrect |
10 ms |
584 KB |
Output isn't correct |
21 |
Runtime error |
31 ms |
1116 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
28 ms |
1152 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
28 ms |
1148 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
30 ms |
1152 KB |
Execution failed because the return code was nonzero |
25 |
Incorrect |
66 ms |
1152 KB |
Output isn't correct |
26 |
Runtime error |
29 ms |
1144 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
29 ms |
1152 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
29 ms |
1156 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
29 ms |
1144 KB |
Execution failed because the return code was nonzero |
30 |
Incorrect |
41 ms |
1152 KB |
Output isn't correct |
31 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
3 ms |
256 KB |
Partially correct |
2 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
3 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
4 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
5 |
Partially correct |
2 ms |
384 KB |
Partially correct |
6 |
Runtime error |
2 ms |
256 KB |
Execution failed because the return code was nonzero |
7 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
8 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
9 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
10 |
Partially correct |
3 ms |
384 KB |
Partially correct |
11 |
Runtime error |
6 ms |
384 KB |
Execution failed because the return code was nonzero |
12 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
13 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
14 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |
15 |
Partially correct |
3 ms |
384 KB |
Partially correct |
16 |
Runtime error |
11 ms |
512 KB |
Execution failed because the return code was nonzero |
17 |
Runtime error |
9 ms |
512 KB |
Execution failed because the return code was nonzero |
18 |
Runtime error |
9 ms |
512 KB |
Execution failed because the return code was nonzero |
19 |
Runtime error |
11 ms |
512 KB |
Execution failed because the return code was nonzero |
20 |
Partially correct |
10 ms |
512 KB |
Partially correct |
21 |
Runtime error |
29 ms |
1144 KB |
Execution failed because the return code was nonzero |
22 |
Runtime error |
25 ms |
1152 KB |
Execution failed because the return code was nonzero |
23 |
Runtime error |
26 ms |
1144 KB |
Execution failed because the return code was nonzero |
24 |
Runtime error |
29 ms |
1088 KB |
Execution failed because the return code was nonzero |
25 |
Partially correct |
67 ms |
1168 KB |
Partially correct |
26 |
Runtime error |
31 ms |
1144 KB |
Execution failed because the return code was nonzero |
27 |
Runtime error |
40 ms |
1144 KB |
Execution failed because the return code was nonzero |
28 |
Runtime error |
28 ms |
1188 KB |
Execution failed because the return code was nonzero |
29 |
Runtime error |
29 ms |
1144 KB |
Execution failed because the return code was nonzero |
30 |
Partially correct |
38 ms |
1152 KB |
Partially correct |
31 |
Runtime error |
2 ms |
384 KB |
Execution failed because the return code was nonzero |
32 |
Runtime error |
3 ms |
384 KB |
Execution failed because the return code was nonzero |