답안 #908627

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
908627 2024-01-16T15:37:00 Z ByeWorld Gap (APIO16_gap) C++14
0 / 100
68 ms 7492 KB
#include "gap.h"
#include <bits/stdc++.h>
#define bupol __builtin_popcount
//#define int long long 
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define lf (id<<1)
#define rg ((id<<1)|1)
#define md ((l+r)>>1)
using namespace std;
const int MAXN = 1e5+5;
const int MAXK = 205;
const int LOG = 20;
const int MOD = 1e9+7;
const int SQRT = 520;
const ll INF = 1e18;
typedef pair<ll,ll> pii;
typedef pair<ll,pii> ipii;

ll mn, mx;
int n;
set<ll> s; ll ans = -INF;
ll le;

long long findGap(int T, int N)
{
	n = N;
	MinMax(1, INF, &mn, &mx); le = mn;
	s.insert(mn); s.insert(mx);

	ll len = mx-mn, idx = mn;
	for(ll i=1; i<=n+1; i++){ // n+1 segment
		ll nx = (len*i) / (n+1) + le;
		if(idx+1 <= nx){
			//cout << idx+1 << ' ' << nx << " p\n";
			MinMax(idx+1, nx, &mn, &mx);
			s.insert(mn); s.insert(mx);
		}

		idx = nx;
	}
	//for(auto in : s) cout << in << " xx\n";
	auto it = s.begin(); ll las = -1;
	while(it != s.end()){
		if(las != -1) ans = max(ans, (*it)-las);
		las = (*it); it++;
	}
	//for(auto in : s) cout << in << " in\n";
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Incorrect 1 ms 2392 KB Output isn't correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Incorrect 1 ms 2392 KB Output isn't correct
5 Incorrect 1 ms 2392 KB Output isn't correct
6 Incorrect 1 ms 2392 KB Output isn't correct
7 Incorrect 1 ms 2392 KB Output isn't correct
8 Incorrect 1 ms 2392 KB Output isn't correct
9 Incorrect 1 ms 2392 KB Output isn't correct
10 Incorrect 1 ms 2392 KB Output isn't correct
11 Incorrect 1 ms 2392 KB Output isn't correct
12 Incorrect 1 ms 2392 KB Output isn't correct
13 Incorrect 1 ms 2392 KB Output isn't correct
14 Incorrect 1 ms 2392 KB Output isn't correct
15 Incorrect 1 ms 2392 KB Output isn't correct
16 Incorrect 8 ms 2696 KB Output isn't correct
17 Incorrect 8 ms 2576 KB Output isn't correct
18 Incorrect 7 ms 2584 KB Output isn't correct
19 Incorrect 7 ms 2584 KB Output isn't correct
20 Incorrect 7 ms 2572 KB Output isn't correct
21 Incorrect 27 ms 2648 KB Output isn't correct
22 Incorrect 27 ms 2856 KB Output isn't correct
23 Incorrect 33 ms 3320 KB Output isn't correct
24 Incorrect 28 ms 2860 KB Output isn't correct
25 Incorrect 68 ms 7460 KB Output isn't correct
26 Incorrect 27 ms 2856 KB Output isn't correct
27 Incorrect 27 ms 2856 KB Output isn't correct
28 Incorrect 26 ms 2856 KB Output isn't correct
29 Incorrect 28 ms 2856 KB Output isn't correct
30 Incorrect 30 ms 3608 KB Output isn't correct
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 1 ms 2392 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 2392 KB Partially correct
2 Incorrect 1 ms 2392 KB Output isn't correct
3 Incorrect 1 ms 2392 KB Output isn't correct
4 Incorrect 1 ms 2392 KB Output isn't correct
5 Partially correct 1 ms 2392 KB Partially correct
6 Incorrect 1 ms 2392 KB Output isn't correct
7 Incorrect 1 ms 2392 KB Output isn't correct
8 Incorrect 1 ms 2392 KB Output isn't correct
9 Incorrect 1 ms 2400 KB Output isn't correct
10 Partially correct 1 ms 2392 KB Partially correct
11 Incorrect 1 ms 2392 KB Output isn't correct
12 Incorrect 1 ms 2392 KB Output isn't correct
13 Incorrect 1 ms 2392 KB Output isn't correct
14 Incorrect 2 ms 2392 KB Output isn't correct
15 Partially correct 2 ms 2392 KB Partially correct
16 Incorrect 9 ms 2580 KB Output isn't correct
17 Incorrect 7 ms 2588 KB Output isn't correct
18 Incorrect 7 ms 2596 KB Output isn't correct
19 Incorrect 7 ms 2584 KB Output isn't correct
20 Partially correct 7 ms 2576 KB Partially correct
21 Incorrect 27 ms 2852 KB Output isn't correct
22 Incorrect 27 ms 2852 KB Output isn't correct
23 Incorrect 27 ms 2856 KB Output isn't correct
24 Incorrect 27 ms 2852 KB Output isn't correct
25 Partially correct 67 ms 7492 KB Partially correct
26 Incorrect 30 ms 2716 KB Output isn't correct
27 Incorrect 27 ms 2816 KB Output isn't correct
28 Incorrect 27 ms 2852 KB Output isn't correct
29 Incorrect 28 ms 3352 KB Output isn't correct
30 Partially correct 31 ms 3672 KB Partially correct
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 1 ms 2392 KB Output isn't correct