#include "gap.h"
#include "bits/stdc++.h"
using namespace std;
long long findGap(int T, int N)
{
vector<long long>ll;
long long a = 0,b = 1e18,d;
MinMax(a,b,&a,&b);
ll.push_back(a);
a++;
while(ll.size()<N)
{
b = a+1;
MinMax(a,b,&b,&d);
if(b!=-1)
{
a = b;
ll.push_back(a);
}
a++;
}
long long ans = 0;
// for(int i = 0;i<N;i++)
// cout<<ll[i]<<' ';
// cout<<endl;
for(int i = 1;i<N;i++)
{
ans = max(ans,ll[i]-ll[i-1]);
}
return ans;
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:11:20: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
11 | while(ll.size()<N)
| ~~~~~~~~~^~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3061 ms |
208 KB |
Time limit exceeded |
2 |
Execution timed out |
3032 ms |
208 KB |
Time limit exceeded |
3 |
Execution timed out |
3063 ms |
208 KB |
Time limit exceeded |
4 |
Execution timed out |
3071 ms |
208 KB |
Time limit exceeded |
5 |
Incorrect |
1016 ms |
304 KB |
Output isn't correct |
6 |
Execution timed out |
3070 ms |
208 KB |
Time limit exceeded |
7 |
Execution timed out |
3057 ms |
208 KB |
Time limit exceeded |
8 |
Execution timed out |
3084 ms |
208 KB |
Time limit exceeded |
9 |
Execution timed out |
3062 ms |
208 KB |
Time limit exceeded |
10 |
Incorrect |
59 ms |
208 KB |
Output isn't correct |
11 |
Execution timed out |
3088 ms |
208 KB |
Time limit exceeded |
12 |
Execution timed out |
3092 ms |
208 KB |
Time limit exceeded |
13 |
Execution timed out |
3054 ms |
336 KB |
Time limit exceeded |
14 |
Execution timed out |
3097 ms |
208 KB |
Time limit exceeded |
15 |
Execution timed out |
3035 ms |
208 KB |
Time limit exceeded |
16 |
Execution timed out |
3062 ms |
428 KB |
Time limit exceeded |
17 |
Execution timed out |
3038 ms |
424 KB |
Time limit exceeded |
18 |
Execution timed out |
3087 ms |
464 KB |
Time limit exceeded |
19 |
Execution timed out |
3039 ms |
432 KB |
Time limit exceeded |
20 |
Incorrect |
141 ms |
844 KB |
Output isn't correct |
21 |
Execution timed out |
3036 ms |
1052 KB |
Time limit exceeded |
22 |
Execution timed out |
3062 ms |
976 KB |
Time limit exceeded |
23 |
Execution timed out |
3052 ms |
1036 KB |
Time limit exceeded |
24 |
Execution timed out |
3064 ms |
1068 KB |
Time limit exceeded |
25 |
Execution timed out |
3063 ms |
1056 KB |
Time limit exceeded |
26 |
Execution timed out |
3046 ms |
1008 KB |
Time limit exceeded |
27 |
Execution timed out |
3004 ms |
1060 KB |
Time limit exceeded |
28 |
Execution timed out |
3058 ms |
1060 KB |
Time limit exceeded |
29 |
Execution timed out |
3065 ms |
1020 KB |
Time limit exceeded |
30 |
Incorrect |
188 ms |
2252 KB |
Output isn't correct |
31 |
Execution timed out |
3093 ms |
208 KB |
Time limit exceeded |
32 |
Execution timed out |
3078 ms |
208 KB |
Time limit exceeded |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3072 ms |
208 KB |
Time limit exceeded |
2 |
Execution timed out |
3072 ms |
208 KB |
Time limit exceeded |
3 |
Execution timed out |
3063 ms |
208 KB |
Time limit exceeded |
4 |
Execution timed out |
3046 ms |
208 KB |
Time limit exceeded |
5 |
Partially correct |
1012 ms |
300 KB |
Partially correct |
6 |
Execution timed out |
3054 ms |
208 KB |
Time limit exceeded |
7 |
Execution timed out |
3067 ms |
208 KB |
Time limit exceeded |
8 |
Execution timed out |
3087 ms |
208 KB |
Time limit exceeded |
9 |
Execution timed out |
3042 ms |
208 KB |
Time limit exceeded |
10 |
Partially correct |
67 ms |
304 KB |
Partially correct |
11 |
Execution timed out |
3077 ms |
208 KB |
Time limit exceeded |
12 |
Execution timed out |
3056 ms |
208 KB |
Time limit exceeded |
13 |
Execution timed out |
3064 ms |
208 KB |
Time limit exceeded |
14 |
Execution timed out |
3060 ms |
336 KB |
Time limit exceeded |
15 |
Execution timed out |
3063 ms |
208 KB |
Time limit exceeded |
16 |
Execution timed out |
3047 ms |
464 KB |
Time limit exceeded |
17 |
Execution timed out |
3078 ms |
480 KB |
Time limit exceeded |
18 |
Execution timed out |
3075 ms |
464 KB |
Time limit exceeded |
19 |
Execution timed out |
3068 ms |
464 KB |
Time limit exceeded |
20 |
Partially correct |
141 ms |
876 KB |
Partially correct |
21 |
Execution timed out |
3022 ms |
984 KB |
Time limit exceeded |
22 |
Execution timed out |
3052 ms |
1004 KB |
Time limit exceeded |
23 |
Execution timed out |
3055 ms |
1012 KB |
Time limit exceeded |
24 |
Execution timed out |
3036 ms |
1056 KB |
Time limit exceeded |
25 |
Execution timed out |
3054 ms |
976 KB |
Time limit exceeded |
26 |
Execution timed out |
3054 ms |
1056 KB |
Time limit exceeded |
27 |
Execution timed out |
3041 ms |
1020 KB |
Time limit exceeded |
28 |
Execution timed out |
3042 ms |
1040 KB |
Time limit exceeded |
29 |
Execution timed out |
3059 ms |
1052 KB |
Time limit exceeded |
30 |
Partially correct |
200 ms |
2188 KB |
Partially correct |
31 |
Execution timed out |
3085 ms |
208 KB |
Time limit exceeded |
32 |
Execution timed out |
3093 ms |
208 KB |
Time limit exceeded |