# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
906910 |
2024-01-15T04:45:56 Z |
ByeWorld |
Gap (APIO16_gap) |
C++14 |
|
69 ms |
8028 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+10;
typedef pair<ll,ll> pii;
typedef pair<ll,pii> ipii;
ll mn, mx;
ll x, y;
int n;
set<ll> s; ll ans = -INF;
void sol(ll l, ll r){ // cari semua di range l-r
cout << l << ' '<< r << " p\n";
if(l > r) return;
MinMax(l, r, &mn, &mx);
if(mn == -1) return; // gk ada
s.insert(mn); s.insert(mx);
int tmn = mn, tmx = mx;
tmn++; tmx--;
sol(tmn, ((tmn+tmx)>>1) );
//cout << ((tmn+tmx)>>1)+1 << ' '<< tmx << " oo\n";
sol(((tmn+tmx)>>1)+1, tmx);
}
long long findGap(int T, int N)
{
n = N;
sol(0, INF);
//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;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Expected EOLN |
2 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
3 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
4 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
5 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
6 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
7 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
8 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
9 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
10 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
11 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
12 |
Incorrect |
2 ms |
2392 KB |
Expected EOLN |
13 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
14 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
15 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
16 |
Incorrect |
4 ms |
2584 KB |
Expected EOLN |
17 |
Incorrect |
4 ms |
2744 KB |
Expected EOLN |
18 |
Incorrect |
4 ms |
2584 KB |
Expected EOLN |
19 |
Incorrect |
4 ms |
2752 KB |
Expected EOLN |
20 |
Incorrect |
14 ms |
3592 KB |
Expected EOLN |
21 |
Incorrect |
13 ms |
3016 KB |
Expected EOLN |
22 |
Incorrect |
13 ms |
2848 KB |
Expected EOLN |
23 |
Incorrect |
13 ms |
2852 KB |
Expected EOLN |
24 |
Incorrect |
13 ms |
3016 KB |
Expected EOLN |
25 |
Incorrect |
10 ms |
2852 KB |
Expected EOLN |
26 |
Incorrect |
13 ms |
2848 KB |
Expected EOLN |
27 |
Incorrect |
13 ms |
2856 KB |
Expected EOLN |
28 |
Incorrect |
17 ms |
3096 KB |
Expected EOLN |
29 |
Incorrect |
15 ms |
2832 KB |
Expected EOLN |
30 |
Incorrect |
69 ms |
7840 KB |
Expected EOLN |
31 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
32 |
Incorrect |
1 ms |
2488 KB |
Expected EOLN |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
2 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
3 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
4 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
5 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
6 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
7 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
8 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
9 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
10 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
11 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
12 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
13 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
14 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
15 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
16 |
Incorrect |
4 ms |
2672 KB |
Expected EOLN |
17 |
Incorrect |
4 ms |
2592 KB |
Expected EOLN |
18 |
Incorrect |
4 ms |
2580 KB |
Expected EOLN |
19 |
Incorrect |
4 ms |
2588 KB |
Expected EOLN |
20 |
Incorrect |
14 ms |
3804 KB |
Expected EOLN |
21 |
Incorrect |
13 ms |
2856 KB |
Expected EOLN |
22 |
Incorrect |
14 ms |
2852 KB |
Expected EOLN |
23 |
Incorrect |
13 ms |
2852 KB |
Expected EOLN |
24 |
Incorrect |
15 ms |
2860 KB |
Expected EOLN |
25 |
Incorrect |
10 ms |
2852 KB |
Expected EOLN |
26 |
Incorrect |
13 ms |
2852 KB |
Expected EOLN |
27 |
Incorrect |
14 ms |
2856 KB |
Expected EOLN |
28 |
Incorrect |
14 ms |
2852 KB |
Expected EOLN |
29 |
Incorrect |
16 ms |
2864 KB |
Expected EOLN |
30 |
Incorrect |
67 ms |
8028 KB |
Expected EOLN |
31 |
Incorrect |
3 ms |
2644 KB |
Expected EOLN |
32 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |