답안 #68125

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
68125 2018-08-16T03:58:18 Z shoemakerjo Gap (APIO16_gap) C++14
70 / 100
106 ms 39864 KB
#include "gap.h"
#include <bits/stdc++.h>

using namespace std;
#define ll long long

ll findGap(int T, int N)
{
	ll lo, hi;
	MinMax(1, 1000000000000000000LL, &lo, &hi);
	ll alph = (hi-lo)/N;
	if ((hi-lo)%N != 0) alph+=1LL;
	vector<ll> nums; //all the ones we care about
	ll st = lo+1LL;
	nums.push_back(lo);
	while (st <= hi) {
		ll c1, c2;
		MinMax(st, st+alph, &c1, &c2);
		if (c1 != -1) {
			nums.push_back(c1);
			nums.push_back(c2);
		}
		st += alph+1LL;
	}
	ll ans = alph;
	for (int i = 1; i < nums.size(); i++) {
		ans = max(ans, nums[i]-nums[i-1]);
	}

	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:26:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 1; i < nums.size(); i++) {
                  ~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 248 KB Output isn't correct
2 Incorrect 3 ms 488 KB Output isn't correct
3 Incorrect 3 ms 488 KB Output isn't correct
4 Incorrect 3 ms 528 KB Output isn't correct
5 Incorrect 3 ms 736 KB Output isn't correct
6 Incorrect 4 ms 736 KB Output isn't correct
7 Incorrect 3 ms 736 KB Output isn't correct
8 Incorrect 2 ms 736 KB Output isn't correct
9 Incorrect 3 ms 736 KB Output isn't correct
10 Incorrect 2 ms 736 KB Output isn't correct
11 Incorrect 3 ms 736 KB Output isn't correct
12 Incorrect 4 ms 748 KB Output isn't correct
13 Incorrect 5 ms 792 KB Output isn't correct
14 Incorrect 5 ms 836 KB Output isn't correct
15 Incorrect 4 ms 908 KB Output isn't correct
16 Incorrect 31 ms 2048 KB Output isn't correct
17 Incorrect 26 ms 2424 KB Output isn't correct
18 Incorrect 24 ms 2844 KB Output isn't correct
19 Incorrect 23 ms 3396 KB Output isn't correct
20 Incorrect 13 ms 3396 KB Output isn't correct
21 Incorrect 97 ms 6764 KB Output isn't correct
22 Incorrect 101 ms 8472 KB Output isn't correct
23 Incorrect 85 ms 10460 KB Output isn't correct
24 Incorrect 86 ms 12308 KB Output isn't correct
25 Incorrect 87 ms 14420 KB Output isn't correct
26 Incorrect 87 ms 15316 KB Output isn't correct
27 Incorrect 106 ms 17104 KB Output isn't correct
28 Incorrect 87 ms 19076 KB Output isn't correct
29 Incorrect 106 ms 20936 KB Output isn't correct
30 Incorrect 42 ms 20936 KB Output isn't correct
31 Incorrect 2 ms 20936 KB Output isn't correct
32 Incorrect 3 ms 20936 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 20936 KB Output is correct
2 Correct 3 ms 20936 KB Output is correct
3 Correct 4 ms 20936 KB Output is correct
4 Correct 2 ms 20936 KB Output is correct
5 Correct 2 ms 20936 KB Output is correct
6 Correct 2 ms 20936 KB Output is correct
7 Correct 2 ms 20936 KB Output is correct
8 Correct 3 ms 20936 KB Output is correct
9 Correct 2 ms 20936 KB Output is correct
10 Correct 2 ms 20936 KB Output is correct
11 Correct 4 ms 20936 KB Output is correct
12 Correct 5 ms 20936 KB Output is correct
13 Correct 5 ms 20936 KB Output is correct
14 Correct 3 ms 20936 KB Output is correct
15 Correct 4 ms 20936 KB Output is correct
16 Correct 22 ms 20936 KB Output is correct
17 Correct 30 ms 21456 KB Output is correct
18 Correct 28 ms 21920 KB Output is correct
19 Correct 25 ms 22256 KB Output is correct
20 Correct 17 ms 22256 KB Output is correct
21 Correct 92 ms 25556 KB Output is correct
22 Correct 85 ms 27396 KB Output is correct
23 Correct 83 ms 29256 KB Output is correct
24 Correct 91 ms 31360 KB Output is correct
25 Correct 81 ms 33388 KB Output is correct
26 Correct 95 ms 34272 KB Output is correct
27 Correct 94 ms 36148 KB Output is correct
28 Correct 86 ms 38100 KB Output is correct
29 Correct 99 ms 39864 KB Output is correct
30 Correct 51 ms 39864 KB Output is correct
31 Correct 3 ms 39864 KB Output is correct
32 Correct 3 ms 39864 KB Output is correct