#include "gap.h"
#include <vector>
#include <iostream>
#include <assert.h>
#include <algorithm>
using namespace std;
typedef long long ll;
ll INF=1000000000000000000;
ll x,y;
vector<ll> V;
int c;
long long findGap(int T, int N)
{
y=INF;
while(x!=-1){
MinMax(x,y,&x,&y);
c++;
if(c>(N+1)/2)
assert(false);
if(x==-1)break;
V.push_back(x);
V.push_back(y);
x++;
y--;
if(x>y)break;
}
sort(V.begin(),V.end());
x=0;
for(int i=0;i<V.size()-1;i++)
x=max(x,V[i+1]-V[i]);
return x;
}
/*
1 6
1 2 5 7 8 12
*/
Compilation message
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:34:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<V.size()-1;i++)
~^~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3 ms |
504 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Correct |
3 ms |
708 KB |
Output is correct |
3 |
Correct |
3 ms |
708 KB |
Output is correct |
4 |
Correct |
2 ms |
708 KB |
Output is correct |
5 |
Correct |
3 ms |
708 KB |
Output is correct |
6 |
Runtime error |
3 ms |
708 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
7 |
Runtime error |
3 ms |
708 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
8 |
Runtime error |
3 ms |
708 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
9 |
Runtime error |
3 ms |
708 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
10 |
Correct |
2 ms |
708 KB |
Output is correct |
11 |
Runtime error |
3 ms |
828 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
12 |
Runtime error |
4 ms |
844 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
13 |
Runtime error |
3 ms |
1020 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
14 |
Runtime error |
6 ms |
1020 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
15 |
Runtime error |
4 ms |
1136 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
16 |
Runtime error |
18 ms |
1988 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
17 |
Runtime error |
17 ms |
2032 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
18 |
Runtime error |
18 ms |
2032 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
19 |
Runtime error |
21 ms |
2072 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
20 |
Correct |
18 ms |
2072 KB |
Output is correct |
21 |
Runtime error |
64 ms |
4252 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Runtime error |
65 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
23 |
Runtime error |
63 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
24 |
Runtime error |
64 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
25 |
Runtime error |
62 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
26 |
Runtime error |
64 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
27 |
Runtime error |
64 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
28 |
Runtime error |
61 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
29 |
Runtime error |
64 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
30 |
Correct |
48 ms |
4696 KB |
Output is correct |
31 |
Correct |
3 ms |
4696 KB |
Output is correct |
32 |
Correct |
4 ms |
4696 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Partially correct |
3 ms |
4696 KB |
Partially correct |
3 |
Partially correct |
2 ms |
4696 KB |
Partially correct |
4 |
Partially correct |
2 ms |
4696 KB |
Partially correct |
5 |
Partially correct |
2 ms |
4696 KB |
Partially correct |
6 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
7 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
8 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
9 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
10 |
Partially correct |
2 ms |
4696 KB |
Partially correct |
11 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
12 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
13 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
14 |
Runtime error |
4 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
15 |
Runtime error |
3 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
16 |
Runtime error |
17 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
17 |
Runtime error |
17 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
18 |
Runtime error |
18 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
19 |
Runtime error |
17 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
20 |
Partially correct |
13 ms |
4696 KB |
Partially correct |
21 |
Runtime error |
66 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Runtime error |
63 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
23 |
Runtime error |
65 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
24 |
Runtime error |
63 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
25 |
Runtime error |
66 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
26 |
Runtime error |
63 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
27 |
Runtime error |
72 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
28 |
Runtime error |
60 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
29 |
Runtime error |
71 ms |
4696 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
30 |
Incorrect |
59 ms |
4696 KB |
Expected int32, but "2500100000" found |
31 |
Partially correct |
3 ms |
4696 KB |
Partially correct |
32 |
Partially correct |
3 ms |
4696 KB |
Partially correct |