# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
946689 |
2024-03-14T22:23:16 Z |
Ice_man |
Gap (APIO16_gap) |
C++14 |
|
35 ms |
4244 KB |
#include <iostream>
#include <chrono>
#include <vector>
#include <algorithm>
#include "gap.h"
#define maxn 200005
#define maxlog 20
#define INF 1000000010
#define LINF 1000000000000000005
#define endl '\n'
#define pb(x) push_back(x)
#define X first
#define Y second
#define control cout<<"passed"<<endl;
#pragma GCC optimize("O3" , "Ofast" , "unroll-loops" , "fast-math")
#pragma GCC target("avx2")
using namespace std;
std::chrono::high_resolution_clock::time_point startT, currT;
constexpr double TIME_MULT = 1;
double timePassed()
{
using namespace std::chrono;
currT = high_resolution_clock::now();
double time = duration_cast<duration<double>>(currT - startT).count();
return time * TIME_MULT;
}
vector <long long> nums;
/**void MinMax(long long l , long long r , long long &mn , long long &mx)
{
cout << l << " " << r << endl;
int a , b;
cin >> a >> b;
mn = a;
mx = b;
}*/
long long findGap(int t , int n)
{
long long l = 1;
long long r = LINF;
int q = ((n + 1) / 2);
while(q--)
{
long long mn , mx;
MinMax(l , r , &mn , &mx);
nums.pb(mn);
nums.pb(mx);
l = mn + 1;
r = mx - 1;
}
sort(nums.begin() , nums.end());
reverse(nums.begin() , nums.end());
/**for(int e : nums)
cout << e << " ";
cout << endl;*/
long long ans = 0;
for(int i = 1; i < (int)(nums.size()); i++)
ans = max(ans , abs(nums[i] - nums[i - 1]));
return ans;
}
/**int main()
{
int t , n;
cin >> t >> n;
cout << findGap(t , n) << endl;;
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
2392 KB |
Output is correct |
3 |
Correct |
1 ms |
2392 KB |
Output is correct |
4 |
Correct |
0 ms |
2392 KB |
Output is correct |
5 |
Correct |
1 ms |
2392 KB |
Output is correct |
6 |
Correct |
1 ms |
2392 KB |
Output is correct |
7 |
Correct |
1 ms |
2392 KB |
Output is correct |
8 |
Correct |
1 ms |
2392 KB |
Output is correct |
9 |
Correct |
1 ms |
2392 KB |
Output is correct |
10 |
Correct |
1 ms |
2392 KB |
Output is correct |
11 |
Correct |
1 ms |
2392 KB |
Output is correct |
12 |
Correct |
1 ms |
2392 KB |
Output is correct |
13 |
Correct |
1 ms |
2392 KB |
Output is correct |
14 |
Correct |
1 ms |
2392 KB |
Output is correct |
15 |
Correct |
1 ms |
2392 KB |
Output is correct |
16 |
Correct |
8 ms |
3084 KB |
Output is correct |
17 |
Correct |
10 ms |
2904 KB |
Output is correct |
18 |
Correct |
8 ms |
2904 KB |
Output is correct |
19 |
Correct |
8 ms |
2844 KB |
Output is correct |
20 |
Correct |
7 ms |
2828 KB |
Output is correct |
21 |
Correct |
32 ms |
3792 KB |
Output is correct |
22 |
Correct |
33 ms |
3996 KB |
Output is correct |
23 |
Correct |
31 ms |
3996 KB |
Output is correct |
24 |
Correct |
35 ms |
3992 KB |
Output is correct |
25 |
Correct |
29 ms |
3992 KB |
Output is correct |
26 |
Correct |
32 ms |
3940 KB |
Output is correct |
27 |
Correct |
32 ms |
3996 KB |
Output is correct |
28 |
Correct |
34 ms |
3776 KB |
Output is correct |
29 |
Correct |
32 ms |
3984 KB |
Output is correct |
30 |
Correct |
27 ms |
4244 KB |
Output is correct |
31 |
Correct |
1 ms |
2392 KB |
Output is correct |
32 |
Correct |
1 ms |
2392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2392 KB |
Output is correct |
2 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
3 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
4 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
5 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
6 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
7 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
8 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
9 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
10 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
11 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
12 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
13 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
14 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
15 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
16 |
Partially correct |
8 ms |
2840 KB |
Partially correct |
17 |
Partially correct |
8 ms |
2844 KB |
Partially correct |
18 |
Partially correct |
8 ms |
2840 KB |
Partially correct |
19 |
Partially correct |
10 ms |
2840 KB |
Partially correct |
20 |
Partially correct |
9 ms |
2820 KB |
Partially correct |
21 |
Incorrect |
31 ms |
3988 KB |
Expected int32, but "2500100000" found |
22 |
Incorrect |
32 ms |
3996 KB |
Expected int32, but "2500100000" found |
23 |
Incorrect |
31 ms |
4036 KB |
Expected int32, but "2500100000" found |
24 |
Incorrect |
32 ms |
3824 KB |
Expected int32, but "2500100000" found |
25 |
Incorrect |
29 ms |
4172 KB |
Expected int32, but "2500100000" found |
26 |
Incorrect |
31 ms |
3984 KB |
Expected int32, but "2500100000" found |
27 |
Incorrect |
31 ms |
3936 KB |
Expected int32, but "2500100000" found |
28 |
Incorrect |
32 ms |
3988 KB |
Expected int32, but "2500100000" found |
29 |
Incorrect |
32 ms |
3988 KB |
Expected int32, but "2500100000" found |
30 |
Incorrect |
30 ms |
3988 KB |
Expected int32, but "2500100000" found |
31 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
32 |
Partially correct |
1 ms |
2392 KB |
Partially correct |