# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
978073 |
2024-05-08T18:41:37 Z |
IUA_Hasin |
Gap (APIO16_gap) |
C++17 |
|
42 ms |
4724 KB |
#include "gap.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
long long findGap(int T, int N)
{
ll tempa = 0;
ll tempb = 1e18;
ll arr[N];
ll l = 0;
ll r = N-1;
// cout<<tempa<< " " << tempb<<endl;
while(true){
if(l<=r){
ll mn, mx;
MinMax(tempa, tempb, &mn, &mx);
// cout<<mn<<" "<<mx<<endl;
if(mn==-1 || mx==-1){
break;
} else if(mn==mx){
arr[l] = mn;
break;
} else {
tempa = mn+1;
tempb = mx-1;
arr[l] = mn;
arr[r] = mx;
l++;
r--;
}
} else {
break;
}
}
ll ans = 0;
for(int i=0; i<N; i++){
cout << arr[i] << " ";
}
cout<<endl;
for(int i=1; i<N; i++){
ll temp = arr[i]-arr[i-1];
ans = max(temp, ans);
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Expected EOLN |
2 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
3 |
Incorrect |
0 ms |
2392 KB |
Expected EOLN |
4 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
5 |
Incorrect |
0 ms |
2392 KB |
Expected EOLN |
6 |
Incorrect |
1 ms |
2460 KB |
Expected EOLN |
7 |
Incorrect |
2 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 |
2 ms |
2392 KB |
Expected EOLN |
15 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
16 |
Incorrect |
10 ms |
3424 KB |
Expected EOLN |
17 |
Incorrect |
10 ms |
2832 KB |
Expected EOLN |
18 |
Incorrect |
12 ms |
2848 KB |
Expected EOLN |
19 |
Incorrect |
10 ms |
3020 KB |
Expected EOLN |
20 |
Incorrect |
8 ms |
2828 KB |
Expected EOLN |
21 |
Incorrect |
39 ms |
4028 KB |
Expected EOLN |
22 |
Incorrect |
38 ms |
3824 KB |
Expected EOLN |
23 |
Incorrect |
38 ms |
4048 KB |
Expected EOLN |
24 |
Incorrect |
42 ms |
3504 KB |
Expected EOLN |
25 |
Incorrect |
35 ms |
4076 KB |
Expected EOLN |
26 |
Incorrect |
38 ms |
3820 KB |
Expected EOLN |
27 |
Incorrect |
39 ms |
4276 KB |
Expected EOLN |
28 |
Incorrect |
38 ms |
3836 KB |
Expected EOLN |
29 |
Incorrect |
38 ms |
4080 KB |
Expected EOLN |
30 |
Incorrect |
32 ms |
3828 KB |
Expected EOLN |
31 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
32 |
Incorrect |
1 ms |
2392 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 |
0 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 |
2644 KB |
Expected EOLN |
13 |
Incorrect |
1 ms |
2644 KB |
Expected EOLN |
14 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
15 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
16 |
Incorrect |
10 ms |
3256 KB |
Expected EOLN |
17 |
Incorrect |
10 ms |
2844 KB |
Expected EOLN |
18 |
Incorrect |
10 ms |
2848 KB |
Expected EOLN |
19 |
Incorrect |
10 ms |
2836 KB |
Expected EOLN |
20 |
Incorrect |
8 ms |
2828 KB |
Expected EOLN |
21 |
Incorrect |
38 ms |
3632 KB |
Expected EOLN |
22 |
Incorrect |
38 ms |
4724 KB |
Expected EOLN |
23 |
Incorrect |
39 ms |
4252 KB |
Expected EOLN |
24 |
Incorrect |
38 ms |
3876 KB |
Expected EOLN |
25 |
Incorrect |
34 ms |
4460 KB |
Expected EOLN |
26 |
Incorrect |
38 ms |
4040 KB |
Expected EOLN |
27 |
Incorrect |
38 ms |
4192 KB |
Expected EOLN |
28 |
Incorrect |
39 ms |
3828 KB |
Expected EOLN |
29 |
Incorrect |
41 ms |
4292 KB |
Expected EOLN |
30 |
Incorrect |
31 ms |
4112 KB |
Expected EOLN |
31 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |
32 |
Incorrect |
1 ms |
2392 KB |
Expected EOLN |