#include "gap.h"
#include<bits/stdc++.h>
using namespace std;
stack<long long> st;
vector<long long> arr;
long long findGap(int T, int N)
{
long long ans=LLONG_MIN;
long long l=-1,r=1e18+1,mn,mx;
while(l+1<=r-1){
MinMax(l+1,r-1,&mn,&mx);
if(mn==-1) break;
arr.push_back(mn);
if(mn!=mx) st.push(mx);
}
while(!st.empty()) arr.push_back(st.top()),st.pop();
for(int i=0;i<N-1;i++){
ans=max(ans,arr[i+1]-arr[i]);
}
/*for(int i=0;i<N;i++) cout<<arr[i] <<" ";
cout<<"\n\n";*/
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
673 ms |
524288 KB |
Execution killed with signal 9 |
2 |
Runtime error |
1281 ms |
524288 KB |
Execution killed with signal 9 |
3 |
Runtime error |
1209 ms |
524288 KB |
Execution killed with signal 9 |
4 |
Runtime error |
1208 ms |
524288 KB |
Execution killed with signal 9 |
5 |
Runtime error |
1255 ms |
524288 KB |
Execution killed with signal 9 |
6 |
Runtime error |
1753 ms |
524288 KB |
Execution killed with signal 9 |
7 |
Runtime error |
1648 ms |
524288 KB |
Execution killed with signal 9 |
8 |
Runtime error |
1631 ms |
524288 KB |
Execution killed with signal 9 |
9 |
Runtime error |
1704 ms |
524288 KB |
Execution killed with signal 9 |
10 |
Runtime error |
1640 ms |
524288 KB |
Execution killed with signal 9 |
11 |
Execution timed out |
2576 ms |
524288 KB |
Time limit exceeded |
12 |
Execution timed out |
2557 ms |
524288 KB |
Time limit exceeded |
13 |
Execution timed out |
2636 ms |
524288 KB |
Time limit exceeded |
14 |
Execution timed out |
2621 ms |
524288 KB |
Time limit exceeded |
15 |
Execution timed out |
2570 ms |
524288 KB |
Time limit exceeded |
16 |
Execution timed out |
3084 ms |
437772 KB |
Time limit exceeded |
17 |
Execution timed out |
3082 ms |
435340 KB |
Time limit exceeded |
18 |
Execution timed out |
3038 ms |
438944 KB |
Time limit exceeded |
19 |
Execution timed out |
3026 ms |
421936 KB |
Time limit exceeded |
20 |
Execution timed out |
3064 ms |
429732 KB |
Time limit exceeded |
21 |
Execution timed out |
3076 ms |
401332 KB |
Time limit exceeded |
22 |
Execution timed out |
3087 ms |
401176 KB |
Time limit exceeded |
23 |
Execution timed out |
3060 ms |
401320 KB |
Time limit exceeded |
24 |
Execution timed out |
3083 ms |
401300 KB |
Time limit exceeded |
25 |
Execution timed out |
3081 ms |
401368 KB |
Time limit exceeded |
26 |
Execution timed out |
3087 ms |
401256 KB |
Time limit exceeded |
27 |
Execution timed out |
3083 ms |
401336 KB |
Time limit exceeded |
28 |
Execution timed out |
3070 ms |
401372 KB |
Time limit exceeded |
29 |
Execution timed out |
3066 ms |
401148 KB |
Time limit exceeded |
30 |
Execution timed out |
3102 ms |
401340 KB |
Time limit exceeded |
31 |
Runtime error |
1843 ms |
524288 KB |
Execution killed with signal 9 |
32 |
Runtime error |
1827 ms |
524288 KB |
Execution killed with signal 9 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
821 ms |
524288 KB |
Execution killed with signal 9 |
2 |
Runtime error |
1257 ms |
524288 KB |
Execution killed with signal 9 |
3 |
Runtime error |
1247 ms |
524288 KB |
Execution killed with signal 9 |
4 |
Runtime error |
1235 ms |
524288 KB |
Execution killed with signal 9 |
5 |
Runtime error |
1218 ms |
524288 KB |
Execution killed with signal 9 |
6 |
Runtime error |
1736 ms |
524288 KB |
Execution killed with signal 9 |
7 |
Runtime error |
1673 ms |
524288 KB |
Execution killed with signal 9 |
8 |
Runtime error |
1677 ms |
524288 KB |
Execution killed with signal 9 |
9 |
Runtime error |
1739 ms |
524288 KB |
Execution killed with signal 9 |
10 |
Runtime error |
1671 ms |
524288 KB |
Execution killed with signal 9 |
11 |
Execution timed out |
2589 ms |
524288 KB |
Time limit exceeded |
12 |
Execution timed out |
2664 ms |
524288 KB |
Time limit exceeded |
13 |
Execution timed out |
2625 ms |
524288 KB |
Time limit exceeded |
14 |
Execution timed out |
2744 ms |
524288 KB |
Time limit exceeded |
15 |
Execution timed out |
2706 ms |
524288 KB |
Time limit exceeded |
16 |
Execution timed out |
3037 ms |
413088 KB |
Time limit exceeded |
17 |
Execution timed out |
3094 ms |
425084 KB |
Time limit exceeded |
18 |
Execution timed out |
3104 ms |
435364 KB |
Time limit exceeded |
19 |
Execution timed out |
3073 ms |
435364 KB |
Time limit exceeded |
20 |
Execution timed out |
3080 ms |
415620 KB |
Time limit exceeded |
21 |
Execution timed out |
3037 ms |
401368 KB |
Time limit exceeded |
22 |
Execution timed out |
3086 ms |
401192 KB |
Time limit exceeded |
23 |
Execution timed out |
3075 ms |
401256 KB |
Time limit exceeded |
24 |
Execution timed out |
3071 ms |
401420 KB |
Time limit exceeded |
25 |
Execution timed out |
3030 ms |
401400 KB |
Time limit exceeded |
26 |
Execution timed out |
3091 ms |
401212 KB |
Time limit exceeded |
27 |
Execution timed out |
3089 ms |
401320 KB |
Time limit exceeded |
28 |
Execution timed out |
3059 ms |
401368 KB |
Time limit exceeded |
29 |
Execution timed out |
3064 ms |
401316 KB |
Time limit exceeded |
30 |
Execution timed out |
3077 ms |
401252 KB |
Time limit exceeded |
31 |
Runtime error |
1805 ms |
524288 KB |
Execution killed with signal 9 |
32 |
Runtime error |
1852 ms |
524288 KB |
Execution killed with signal 9 |