Submission #41247

# Submission time Handle Problem Language Result Execution time Memory
41247 2018-02-15T06:17:42 Z Just_Solve_The_Problem Gap (APIO16_gap) C++11
0 / 100
93 ms 39388 KB
#include <gap.h>
#include <bits/stdc++.h> 

#define ll long long

using namespace std;

ll findGap(int t, int n) {
	ll l, r;
	MinMax(0, 1e18, &l, &r);
	l++; r--;
	ll dif = (r - l + 1) / n;
	ll start = l;
	ll fin = start + dif - 1;
	ll fre = 0;
	ll mx = 0; 
	ll ans = 0;
	while (1) {
		ll l1, r1;
		MinMax(start, fin, &l1, &r1);
		if (l1 == -1) {
			fre += dif;
		} else {
			if (fre != 0) {
				ans = max(ans, fre + mx + (l1 - start + 1));
			}
			fre = 0;             
			mx = fin - r1;
		}
		if (fin == r) break;      
		start = fin + 1;
		fin = min(start + dif - 1, r);
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 248 KB Output isn't correct
2 Incorrect 2 ms 484 KB Output isn't correct
3 Incorrect 1 ms 484 KB Output isn't correct
4 Incorrect 2 ms 572 KB Output isn't correct
5 Incorrect 2 ms 572 KB Output isn't correct
6 Incorrect 2 ms 572 KB Output isn't correct
7 Incorrect 1 ms 580 KB Output isn't correct
8 Incorrect 2 ms 752 KB Output isn't correct
9 Incorrect 2 ms 752 KB Output isn't correct
10 Incorrect 2 ms 752 KB Output isn't correct
11 Incorrect 2 ms 752 KB Output isn't correct
12 Incorrect 3 ms 752 KB Output isn't correct
13 Incorrect 3 ms 808 KB Output isn't correct
14 Incorrect 3 ms 932 KB Output isn't correct
15 Incorrect 2 ms 932 KB Output isn't correct
16 Incorrect 20 ms 1556 KB Output isn't correct
17 Incorrect 20 ms 1948 KB Output isn't correct
18 Incorrect 23 ms 2504 KB Output isn't correct
19 Incorrect 20 ms 3060 KB Output isn't correct
20 Incorrect 10 ms 3060 KB Output isn't correct
21 Incorrect 76 ms 5636 KB Output isn't correct
22 Incorrect 73 ms 7352 KB Output isn't correct
23 Incorrect 75 ms 9256 KB Output isn't correct
24 Incorrect 93 ms 11044 KB Output isn't correct
25 Incorrect 67 ms 12244 KB Output isn't correct
26 Incorrect 76 ms 14100 KB Output isn't correct
27 Incorrect 74 ms 16072 KB Output isn't correct
28 Incorrect 76 ms 17788 KB Output isn't correct
29 Incorrect 75 ms 19648 KB Output isn't correct
30 Incorrect 44 ms 20340 KB Output isn't correct
31 Incorrect 2 ms 20340 KB Output isn't correct
32 Incorrect 1 ms 20340 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 20340 KB Output isn't correct
2 Correct 2 ms 20340 KB Output is correct
3 Correct 1 ms 20340 KB Output is correct
4 Correct 1 ms 20340 KB Output is correct
5 Correct 1 ms 20340 KB Output is correct
6 Correct 2 ms 20340 KB Output is correct
7 Correct 2 ms 20340 KB Output is correct
8 Correct 2 ms 20340 KB Output is correct
9 Correct 2 ms 20340 KB Output is correct
10 Correct 2 ms 20340 KB Output is correct
11 Correct 3 ms 20340 KB Output is correct
12 Correct 3 ms 20340 KB Output is correct
13 Correct 3 ms 20340 KB Output is correct
14 Correct 3 ms 20340 KB Output is correct
15 Correct 2 ms 20340 KB Output is correct
16 Correct 20 ms 20480 KB Output is correct
17 Correct 24 ms 20936 KB Output is correct
18 Correct 20 ms 21408 KB Output is correct
19 Correct 20 ms 21872 KB Output is correct
20 Partially correct 9 ms 21952 KB Partially correct
21 Correct 75 ms 24412 KB Output is correct
22 Correct 72 ms 26256 KB Output is correct
23 Correct 74 ms 28100 KB Output is correct
24 Correct 73 ms 29992 KB Output is correct
25 Correct 69 ms 31148 KB Output is correct
26 Correct 75 ms 33020 KB Output is correct
27 Correct 74 ms 34864 KB Output is correct
28 Correct 76 ms 36708 KB Output is correct
29 Correct 81 ms 38568 KB Output is correct
30 Partially correct 41 ms 39388 KB Partially correct
31 Incorrect 2 ms 39388 KB Output isn't correct
32 Correct 2 ms 39388 KB Output is correct