Submission #40859

# Submission time Handle Problem Language Result Execution time Memory
40859 2018-02-09T14:35:14 Z IvanC Gap (APIO16_gap) C++14
0 / 100
2000 ms 524288 KB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
ll NN,TT,maior;
ii binary_search(ll ini,ll fim){
	if(ini == fim) return ii(ini,ini);
	ll copia1 = ini,copia2 = fim;
	MinMax(ini,fim,&copia1,&copia2);
	ini = copia1;
	fim = copia2;
	if(fim - ini <= maior) return ii(ini,fim);
	ll meio = ini + (fim - ini)/2;
	ii novo1 = binary_search(ini,meio);
	ii novo2 = binary_search(meio,fim);
	if(novo1.second != novo2.first) maior = max(maior, novo2.first - novo1.second);
	return ii(ini,fim);
}
ll findGap(int T,int N){
	TT = T;
	NN = N;
	ll ini = 0,fim = (ll)1e18;
	binary_search(ini,fim);
	return maior;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Incorrect 2 ms 480 KB Output isn't correct
3 Incorrect 1 ms 480 KB Output isn't correct
4 Incorrect 1 ms 520 KB Output isn't correct
5 Incorrect 2 ms 520 KB Output isn't correct
6 Incorrect 1 ms 520 KB Output isn't correct
7 Incorrect 1 ms 520 KB Output isn't correct
8 Incorrect 2 ms 520 KB Output isn't correct
9 Incorrect 1 ms 524 KB Output isn't correct
10 Execution timed out 2068 ms 524288 KB Time limit exceeded
11 Correct 2 ms 524288 KB Output is correct
12 Correct 2 ms 524288 KB Output is correct
13 Correct 2 ms 524288 KB Output is correct
14 Correct 2 ms 524288 KB Output is correct
15 Incorrect 3 ms 524288 KB Output isn't correct
16 Correct 14 ms 524288 KB Output is correct
17 Correct 13 ms 524288 KB Output is correct
18 Correct 12 ms 524288 KB Output is correct
19 Correct 13 ms 524288 KB Output is correct
20 Execution timed out 2087 ms 524288 KB Time limit exceeded
21 Correct 44 ms 524288 KB Output is correct
22 Correct 44 ms 524288 KB Output is correct
23 Correct 45 ms 524288 KB Output is correct
24 Correct 46 ms 524288 KB Output is correct
25 Incorrect 89 ms 524288 KB Output isn't correct
26 Correct 42 ms 524288 KB Output is correct
27 Correct 45 ms 524288 KB Output is correct
28 Correct 44 ms 524288 KB Output is correct
29 Correct 46 ms 524288 KB Output is correct
30 Execution timed out 2073 ms 524288 KB Time limit exceeded
31 Execution timed out 2106 ms 524288 KB Time limit exceeded
32 Correct 2 ms 524288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 524288 KB Partially correct
2 Partially correct 1 ms 524288 KB Partially correct
3 Partially correct 1 ms 524288 KB Partially correct
4 Partially correct 2 ms 524288 KB Partially correct
5 Partially correct 1 ms 524288 KB Partially correct
6 Partially correct 2 ms 524288 KB Partially correct
7 Partially correct 2 ms 524288 KB Partially correct
8 Partially correct 2 ms 524288 KB Partially correct
9 Partially correct 1 ms 524288 KB Partially correct
10 Execution timed out 2106 ms 524288 KB Time limit exceeded
11 Partially correct 2 ms 524288 KB Partially correct
12 Partially correct 2 ms 524288 KB Partially correct
13 Partially correct 2 ms 524288 KB Partially correct
14 Partially correct 2 ms 524288 KB Partially correct
15 Partially correct 3 ms 524288 KB Partially correct
16 Partially correct 13 ms 524288 KB Partially correct
17 Partially correct 12 ms 524288 KB Partially correct
18 Partially correct 13 ms 524288 KB Partially correct
19 Partially correct 13 ms 524288 KB Partially correct
20 Execution timed out 2068 ms 524288 KB Time limit exceeded
21 Partially correct 42 ms 524288 KB Partially correct
22 Partially correct 44 ms 524288 KB Partially correct
23 Partially correct 44 ms 524288 KB Partially correct
24 Partially correct 43 ms 524288 KB Partially correct
25 Partially correct 93 ms 524288 KB Partially correct
26 Partially correct 45 ms 524288 KB Partially correct
27 Partially correct 46 ms 524288 KB Partially correct
28 Partially correct 52 ms 524288 KB Partially correct
29 Partially correct 50 ms 524288 KB Partially correct
30 Execution timed out 2087 ms 524288 KB Time limit exceeded
31 Execution timed out 2072 ms 524288 KB Time limit exceeded
32 Partially correct 1 ms 524288 KB Partially correct