Submission #105738

# Submission time Handle Problem Language Result Execution time Memory
105738 2019-04-14T09:13:30 Z Pro_ktmr Gap (APIO16_gap) C++14
0 / 100
99 ms 2808 KB
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define PB push_back
#define MP make_pair
#define MOD 1000000007

#include"gap.h"

//MinMax(LL s, LL t, LL& mn, LL& mx)
//aiのうちs以上の最小の数がmnに、aiのうちt以下の最大値がmxに格納される

//aiの差分のうち最大のものを返す
LL findGap(int T, int N){
	queue<pair<LL,LL>> kukan;
	kukan.push(MP(0LL, 1000000000000000000LL));
	vector<LL> v;
	while(kukan.size() > 0){
		LL m = kukan.front().first;
		LL M = kukan.front().second;
		kukan.pop();
		LL tmp1, tmp2;
		MinMax(m, M, &tmp1, &tmp2);
		if(tmp1 == -1) continue;
		v.PB(tmp1);
		if(tmp1 == tmp2) continue;
		v.PB(tmp2);
		
		LL mid = (tmp1+tmp2) / 2;
		kukan.push(MP(tmp1+1, mid));
		kukan.push(MP(mid+1, tmp2-1));
	}
	sort(v.begin(), v.end());
	LL ans = 0;
	for(int i=1; i<v.size(); i++){
		ans = max(ans, v[i] - v[i-1]);
	}
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:36:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1; i<v.size(); i++){
               ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Incorrect 2 ms 384 KB Output isn't correct
3 Incorrect 2 ms 356 KB Output isn't correct
4 Incorrect 3 ms 384 KB Output isn't correct
5 Incorrect 2 ms 384 KB Output isn't correct
6 Incorrect 3 ms 384 KB Output isn't correct
7 Incorrect 2 ms 384 KB Output isn't correct
8 Incorrect 3 ms 384 KB Output isn't correct
9 Incorrect 3 ms 384 KB Output isn't correct
10 Runtime error 3 ms 384 KB Execution failed because the return code was nonzero
11 Incorrect 3 ms 384 KB Output isn't correct
12 Incorrect 4 ms 384 KB Output isn't correct
13 Incorrect 4 ms 384 KB Output isn't correct
14 Incorrect 3 ms 384 KB Output isn't correct
15 Incorrect 4 ms 256 KB Output isn't correct
16 Incorrect 25 ms 1024 KB Output isn't correct
17 Incorrect 23 ms 896 KB Output isn't correct
18 Incorrect 22 ms 896 KB Output isn't correct
19 Incorrect 25 ms 1024 KB Output isn't correct
20 Runtime error 11 ms 796 KB Execution failed because the return code was nonzero
21 Incorrect 85 ms 2656 KB Output isn't correct
22 Incorrect 79 ms 2664 KB Output isn't correct
23 Incorrect 94 ms 2672 KB Output isn't correct
24 Incorrect 87 ms 2672 KB Output isn't correct
25 Incorrect 60 ms 2672 KB Output isn't correct
26 Incorrect 77 ms 2672 KB Output isn't correct
27 Incorrect 76 ms 2672 KB Output isn't correct
28 Incorrect 76 ms 2672 KB Output isn't correct
29 Incorrect 80 ms 2732 KB Output isn't correct
30 Runtime error 39 ms 1908 KB Execution failed because the return code was nonzero
31 Runtime error 2 ms 384 KB Execution failed because the return code was nonzero
32 Runtime error 2 ms 384 KB Execution failed because the return code was nonzero
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Partially correct 2 ms 384 KB Partially correct
3 Partially correct 3 ms 384 KB Partially correct
4 Partially correct 2 ms 384 KB Partially correct
5 Partially correct 1 ms 384 KB Partially correct
6 Partially correct 2 ms 384 KB Partially correct
7 Partially correct 3 ms 384 KB Partially correct
8 Partially correct 2 ms 384 KB Partially correct
9 Partially correct 3 ms 384 KB Partially correct
10 Runtime error 2 ms 384 KB Execution failed because the return code was nonzero
11 Partially correct 3 ms 384 KB Partially correct
12 Partially correct 3 ms 384 KB Partially correct
13 Partially correct 4 ms 384 KB Partially correct
14 Partially correct 3 ms 384 KB Partially correct
15 Partially correct 3 ms 384 KB Partially correct
16 Partially correct 25 ms 940 KB Partially correct
17 Partially correct 23 ms 1024 KB Partially correct
18 Partially correct 22 ms 896 KB Partially correct
19 Partially correct 20 ms 896 KB Partially correct
20 Runtime error 11 ms 768 KB Execution failed because the return code was nonzero
21 Partially correct 82 ms 2808 KB Partially correct
22 Partially correct 83 ms 2616 KB Partially correct
23 Partially correct 79 ms 2672 KB Partially correct
24 Partially correct 78 ms 2672 KB Partially correct
25 Partially correct 65 ms 2724 KB Partially correct
26 Partially correct 82 ms 2676 KB Partially correct
27 Partially correct 81 ms 2672 KB Partially correct
28 Partially correct 79 ms 2672 KB Partially correct
29 Partially correct 99 ms 2644 KB Partially correct
30 Runtime error 35 ms 1884 KB Execution failed because the return code was nonzero
31 Runtime error 3 ms 384 KB Execution failed because the return code was nonzero
32 Runtime error 2 ms 356 KB Execution failed because the return code was nonzero