#include "gap.h"
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <set>
#include <iterator>
#include <stack>
#include <map>
#include <math.h>
#include <bitset>
#include <deque>
#include <string>
#include <tuple>
#include <queue>
#include <numeric>
#include <complex>
#include <assert.h>
#include <unordered_set>
#include <unordered_map>
using namespace std;
#define ll long long
#define rep(i, a, b) for (long long i = a; i <= b; i++)
#define sz(x) (ll) (x).size ()
long long findGap(int T, int N)
{
ll lo=0;
ll hi=1e18;
vector <ll> f,r;
ll cnt=0;
while(cnt<N)
{
ll mn,mx;
MinMax(lo,hi,&mn,&mx);
if(cnt+1==N)
{
f.push_back(mn);
cnt+=1;
}
else
{
f.push_back(mn);
r.push_back(mx);
cnt+=2;
}
lo=mn;
hi=mx;
}
vector <ll> v;
for(auto x:f)
v.push_back(x);
reverse(r.begin(),r.end());
for(auto x:r)
v.push_back(x);
ll ans=0;
rep(i,0,sz(v)-2)
ans=max(ans,v[i+1]-v[i]);
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
208 KB |
Output is 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 |
1 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 |
0 ms |
208 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
15 |
Incorrect |
0 ms |
336 KB |
Output isn't correct |
16 |
Incorrect |
6 ms |
1168 KB |
Output isn't correct |
17 |
Incorrect |
6 ms |
1168 KB |
Output isn't correct |
18 |
Incorrect |
6 ms |
1168 KB |
Output isn't correct |
19 |
Incorrect |
6 ms |
1168 KB |
Output isn't correct |
20 |
Incorrect |
4 ms |
1104 KB |
Output isn't correct |
21 |
Incorrect |
25 ms |
3016 KB |
Output isn't correct |
22 |
Incorrect |
25 ms |
3016 KB |
Output isn't correct |
23 |
Incorrect |
24 ms |
3012 KB |
Output isn't correct |
24 |
Incorrect |
25 ms |
3052 KB |
Output isn't correct |
25 |
Incorrect |
26 ms |
2992 KB |
Output isn't correct |
26 |
Incorrect |
25 ms |
3040 KB |
Output isn't correct |
27 |
Incorrect |
32 ms |
3016 KB |
Output isn't correct |
28 |
Incorrect |
31 ms |
3000 KB |
Output isn't correct |
29 |
Incorrect |
25 ms |
3012 KB |
Output isn't correct |
30 |
Incorrect |
26 ms |
3060 KB |
Output isn't correct |
31 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
32 |
Incorrect |
1 ms |
208 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is 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 |
1 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 |
0 ms |
208 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
15 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
16 |
Incorrect |
6 ms |
1104 KB |
Output isn't correct |
17 |
Incorrect |
8 ms |
1104 KB |
Output isn't correct |
18 |
Incorrect |
6 ms |
1104 KB |
Output isn't correct |
19 |
Incorrect |
6 ms |
1140 KB |
Output isn't correct |
20 |
Incorrect |
5 ms |
1168 KB |
Output isn't correct |
21 |
Incorrect |
26 ms |
3016 KB |
Expected int32, but "5000050000" found |
22 |
Incorrect |
26 ms |
2928 KB |
Expected int32, but "5000050000" found |
23 |
Incorrect |
25 ms |
3024 KB |
Expected int32, but "5000050000" found |
24 |
Incorrect |
25 ms |
3032 KB |
Expected int32, but "5000050000" found |
25 |
Incorrect |
21 ms |
3036 KB |
Expected int32, but "5000050000" found |
26 |
Incorrect |
25 ms |
2964 KB |
Expected int32, but "5000050000" found |
27 |
Incorrect |
24 ms |
3004 KB |
Expected int32, but "5000050000" found |
28 |
Incorrect |
25 ms |
3052 KB |
Expected int32, but "5000050000" found |
29 |
Incorrect |
31 ms |
2924 KB |
Expected int32, but "5000050000" found |
30 |
Incorrect |
18 ms |
2928 KB |
Expected int32, but "5000050000" found |
31 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
208 KB |
Output isn't correct |