# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
946688 |
2024-03-14T22:18:38 Z |
Ice_man |
Gap (APIO16_gap) |
C++14 |
|
34 ms |
4252 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(mn);
l = mn + 1;
r = mx - 1;
}
sort(nums.begin() , nums.end());
long long ans = -1;
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;
findGap(t , n);
return 0;
}*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
5 |
Correct |
1 ms |
2392 KB |
Output is correct |
6 |
Correct |
0 ms |
2392 KB |
Output is correct |
7 |
Correct |
1 ms |
2392 KB |
Output is correct |
8 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
15 |
Correct |
1 ms |
2392 KB |
Output is correct |
16 |
Correct |
8 ms |
2848 KB |
Output is correct |
17 |
Incorrect |
8 ms |
3092 KB |
Output isn't correct |
18 |
Incorrect |
7 ms |
2836 KB |
Output isn't correct |
19 |
Incorrect |
8 ms |
2840 KB |
Output isn't correct |
20 |
Incorrect |
6 ms |
2824 KB |
Output isn't correct |
21 |
Incorrect |
30 ms |
4004 KB |
Output isn't correct |
22 |
Incorrect |
29 ms |
4252 KB |
Output isn't correct |
23 |
Incorrect |
29 ms |
3992 KB |
Output isn't correct |
24 |
Incorrect |
29 ms |
3860 KB |
Output isn't correct |
25 |
Correct |
27 ms |
3992 KB |
Output is correct |
26 |
Incorrect |
29 ms |
3996 KB |
Output isn't correct |
27 |
Incorrect |
30 ms |
3928 KB |
Output isn't correct |
28 |
Incorrect |
29 ms |
3992 KB |
Output isn't correct |
29 |
Incorrect |
29 ms |
3992 KB |
Output isn't correct |
30 |
Incorrect |
24 ms |
3992 KB |
Output isn't correct |
31 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
32 |
Correct |
0 ms |
2392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
3 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
2392 KB |
Output isn't correct |
5 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
6 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
7 |
Partially correct |
1 ms |
2644 KB |
Partially correct |
8 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
9 |
Partially correct |
0 ms |
2392 KB |
Partially correct |
10 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
11 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
12 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
13 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
14 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
15 |
Partially correct |
1 ms |
2392 KB |
Partially correct |
16 |
Incorrect |
8 ms |
2844 KB |
Output isn't correct |
17 |
Incorrect |
8 ms |
2832 KB |
Output isn't correct |
18 |
Incorrect |
10 ms |
2828 KB |
Output isn't correct |
19 |
Incorrect |
8 ms |
2840 KB |
Output isn't correct |
20 |
Incorrect |
6 ms |
2828 KB |
Output isn't correct |
21 |
Incorrect |
29 ms |
3996 KB |
Expected int32, but "2500100000" found |
22 |
Incorrect |
29 ms |
3984 KB |
Expected int32, but "2500100000" found |
23 |
Incorrect |
29 ms |
3864 KB |
Expected int32, but "2500100000" found |
24 |
Incorrect |
34 ms |
3988 KB |
Expected int32, but "2500100000" found |
25 |
Incorrect |
26 ms |
3996 KB |
Expected int32, but "2500100000" found |
26 |
Incorrect |
29 ms |
3996 KB |
Expected int32, but "2500100000" found |
27 |
Incorrect |
33 ms |
4004 KB |
Expected int32, but "2500100000" found |
28 |
Incorrect |
29 ms |
3992 KB |
Expected int32, but "2500100000" found |
29 |
Incorrect |
30 ms |
3868 KB |
Expected int32, but "2500100000" found |
30 |
Incorrect |
26 ms |
3996 KB |
Expected int32, but "2500100000" found |
31 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
32 |
Partially correct |
1 ms |
2392 KB |
Partially correct |