# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
568647 |
2022-05-26T00:47:25 Z |
Deepesson |
Gap (APIO16_gap) |
C++17 |
|
2000 ms |
8432 KB |
#include <bits/stdc++.h>
///#include "gap.h"
void MinMax(long long, long long, long long*, long long*);
using ll = long long;
long long findGap(int T, int N)
{
if(T==2)
return 0;
else {
std::map<ll,bool> mapa;
ll l=-1,r=1e18+1;
while(l+1<r-1){
ll a,b;
MinMax(l+1,r-1,&a,&b);
if(a!=-1){
mapa[a]=true;
l=a;
}
if(b!=-1){
mapa[b]=true;
r=b;
}
}
ll max=0;
std::vector<ll> vec;
for(auto&x:mapa)vec.push_back(x.first);
for(int i=1;i!=vec.size();++i)max=std::max(max,vec[i]-vec[i-1]);
return max;
}
}
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:30:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
30 | for(int i=1;i!=vec.size();++i)max=std::max(max,vec[i]-vec[i-1]);
| ~^~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3069 ms |
208 KB |
Time limit exceeded |
2 |
Correct |
0 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
208 KB |
Output is correct |
4 |
Correct |
0 ms |
208 KB |
Output is correct |
5 |
Correct |
0 ms |
208 KB |
Output is correct |
6 |
Execution timed out |
3065 ms |
208 KB |
Time limit exceeded |
7 |
Execution timed out |
3089 ms |
208 KB |
Time limit exceeded |
8 |
Execution timed out |
3077 ms |
208 KB |
Time limit exceeded |
9 |
Execution timed out |
3099 ms |
208 KB |
Time limit exceeded |
10 |
Correct |
1 ms |
208 KB |
Output is correct |
11 |
Execution timed out |
3081 ms |
400 KB |
Time limit exceeded |
12 |
Execution timed out |
3071 ms |
336 KB |
Time limit exceeded |
13 |
Execution timed out |
3077 ms |
336 KB |
Time limit exceeded |
14 |
Execution timed out |
3079 ms |
336 KB |
Time limit exceeded |
15 |
Execution timed out |
3062 ms |
336 KB |
Time limit exceeded |
16 |
Execution timed out |
3056 ms |
2000 KB |
Time limit exceeded |
17 |
Execution timed out |
3070 ms |
2060 KB |
Time limit exceeded |
18 |
Execution timed out |
3050 ms |
1936 KB |
Time limit exceeded |
19 |
Execution timed out |
3070 ms |
2016 KB |
Time limit exceeded |
20 |
Correct |
13 ms |
2384 KB |
Output is correct |
21 |
Execution timed out |
3039 ms |
7320 KB |
Time limit exceeded |
22 |
Execution timed out |
3035 ms |
7252 KB |
Time limit exceeded |
23 |
Execution timed out |
3044 ms |
7224 KB |
Time limit exceeded |
24 |
Execution timed out |
3062 ms |
7240 KB |
Time limit exceeded |
25 |
Execution timed out |
3072 ms |
7236 KB |
Time limit exceeded |
26 |
Execution timed out |
3066 ms |
7320 KB |
Time limit exceeded |
27 |
Execution timed out |
3060 ms |
7216 KB |
Time limit exceeded |
28 |
Execution timed out |
3067 ms |
7308 KB |
Time limit exceeded |
29 |
Execution timed out |
3072 ms |
7284 KB |
Time limit exceeded |
30 |
Correct |
51 ms |
8432 KB |
Output is correct |
31 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
32 |
Correct |
0 ms |
208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
336 KB |
Output isn't correct |
15 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
16 |
Incorrect |
6 ms |
464 KB |
Output isn't correct |
17 |
Incorrect |
5 ms |
448 KB |
Output isn't correct |
18 |
Incorrect |
6 ms |
464 KB |
Output isn't correct |
19 |
Incorrect |
6 ms |
464 KB |
Output isn't correct |
20 |
Incorrect |
3 ms |
464 KB |
Output isn't correct |
21 |
Incorrect |
17 ms |
1072 KB |
Output isn't correct |
22 |
Incorrect |
17 ms |
1060 KB |
Output isn't correct |
23 |
Incorrect |
19 ms |
968 KB |
Output isn't correct |
24 |
Incorrect |
15 ms |
1108 KB |
Output isn't correct |
25 |
Incorrect |
13 ms |
976 KB |
Output isn't correct |
26 |
Incorrect |
23 ms |
960 KB |
Output isn't correct |
27 |
Incorrect |
18 ms |
1060 KB |
Output isn't correct |
28 |
Incorrect |
24 ms |
1052 KB |
Output isn't correct |
29 |
Incorrect |
18 ms |
984 KB |
Output isn't correct |
30 |
Incorrect |
10 ms |
1072 KB |
Output isn't correct |
31 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |