#include <bits/stdc++.h>
//#include "grader.cpp"
#include "gap.h"
#pragma GCC optimize("O3")
using namespace std;
#define ll long long
#define lol long long
#define pb push_back
//#define mp make_pair
#define fr first
#define sc second
#define MAX ((lol)(1e15+100))
#define MX ((lol)(4e9+100))
#define ARRS ((lol)(1e6+100))
#define MOD ((lol)(1e9+7))
#define EP ((double)(1e-9))
#define EPS ((double)(1e-8))
#define pb push_back
#define PI ((double)3.141592653)
#define LG 21
long long findGap(int T, int n)
{
vector<ll> v;
ll k,p;
MinMax(0,1e18,&k,&p);
v.pb(k);
v.pb(p);
ll l=k+1,r=p-1;
ll t=(r-l)/n;
t=max(t,1ll);
for(ll i=l; i<=r; i+=t){
MinMax(i,min(r,i+t-1),&k,&p);
if(k<0)continue;
v.pb(k);
v.pb(p);
}
sort(v.begin(),v.end());
ll pas=0;
for(int i=1; i<v.size(); i++){
pas=max(pas,v[i]-v[i-1]);
}
return pas;
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:44:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1; i<v.size(); i++){
~^~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
496 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
496 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
496 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
620 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
620 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
620 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
620 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
620 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
620 KB |
Output isn't correct |
11 |
Incorrect |
3 ms |
636 KB |
Output isn't correct |
12 |
Incorrect |
3 ms |
664 KB |
Output isn't correct |
13 |
Incorrect |
3 ms |
716 KB |
Output isn't correct |
14 |
Incorrect |
3 ms |
744 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
792 KB |
Output isn't correct |
16 |
Incorrect |
20 ms |
1832 KB |
Output isn't correct |
17 |
Incorrect |
20 ms |
2292 KB |
Output isn't correct |
18 |
Incorrect |
20 ms |
2748 KB |
Output isn't correct |
19 |
Incorrect |
20 ms |
3212 KB |
Output isn't correct |
20 |
Incorrect |
10 ms |
3212 KB |
Output isn't correct |
21 |
Incorrect |
77 ms |
6512 KB |
Output isn't correct |
22 |
Incorrect |
75 ms |
8356 KB |
Output isn't correct |
23 |
Incorrect |
76 ms |
10260 KB |
Output isn't correct |
24 |
Incorrect |
77 ms |
12044 KB |
Output isn't correct |
25 |
Incorrect |
73 ms |
14264 KB |
Output isn't correct |
26 |
Incorrect |
76 ms |
15052 KB |
Output isn't correct |
27 |
Incorrect |
83 ms |
15740 KB |
Output isn't correct |
28 |
Incorrect |
76 ms |
15740 KB |
Output isn't correct |
29 |
Incorrect |
87 ms |
15740 KB |
Output isn't correct |
30 |
Incorrect |
49 ms |
15740 KB |
Output isn't correct |
31 |
Incorrect |
2 ms |
15740 KB |
Output isn't correct |
32 |
Incorrect |
2 ms |
15740 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
15740 KB |
Output is correct |
2 |
Correct |
2 ms |
15740 KB |
Output is correct |
3 |
Correct |
2 ms |
15740 KB |
Output is correct |
4 |
Correct |
2 ms |
15740 KB |
Output is correct |
5 |
Correct |
2 ms |
15740 KB |
Output is correct |
6 |
Correct |
2 ms |
15740 KB |
Output is correct |
7 |
Correct |
2 ms |
15740 KB |
Output is correct |
8 |
Correct |
2 ms |
15740 KB |
Output is correct |
9 |
Correct |
2 ms |
15740 KB |
Output is correct |
10 |
Correct |
2 ms |
15740 KB |
Output is correct |
11 |
Correct |
4 ms |
15740 KB |
Output is correct |
12 |
Correct |
3 ms |
15740 KB |
Output is correct |
13 |
Correct |
3 ms |
15740 KB |
Output is correct |
14 |
Correct |
3 ms |
15740 KB |
Output is correct |
15 |
Correct |
3 ms |
15740 KB |
Output is correct |
16 |
Correct |
20 ms |
15740 KB |
Output is correct |
17 |
Correct |
20 ms |
15740 KB |
Output is correct |
18 |
Correct |
20 ms |
15740 KB |
Output is correct |
19 |
Correct |
19 ms |
15740 KB |
Output is correct |
20 |
Partially correct |
9 ms |
15740 KB |
Partially correct |
21 |
Correct |
75 ms |
15740 KB |
Output is correct |
22 |
Correct |
75 ms |
15740 KB |
Output is correct |
23 |
Correct |
75 ms |
15740 KB |
Output is correct |
24 |
Correct |
75 ms |
15740 KB |
Output is correct |
25 |
Correct |
73 ms |
16668 KB |
Output is correct |
26 |
Correct |
76 ms |
16668 KB |
Output is correct |
27 |
Correct |
75 ms |
16668 KB |
Output is correct |
28 |
Correct |
75 ms |
16668 KB |
Output is correct |
29 |
Correct |
75 ms |
16668 KB |
Output is correct |
30 |
Partially correct |
49 ms |
16668 KB |
Partially correct |
31 |
Correct |
2 ms |
16668 KB |
Output is correct |
32 |
Correct |
2 ms |
16668 KB |
Output is correct |