Submission #946679

# Submission time Handle Problem Language Result Execution time Memory
946679 2024-03-14T22:09:46 Z Ice_man Gap (APIO16_gap) C++14
0 / 100
35 ms 3996 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;


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 = LINF;

    for(int i = 1; i < nums.size(); i++)
        ans = max(ans , abs(nums[i] - nums[i - 1]));

    return ans;
}






Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:60:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   60 |     for(int i = 1; i < nums.size(); i++)
      |                    ~~^~~~~~~~~~~~~
# 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 Incorrect 0 ms 2392 KB Output isn't correct
6 Incorrect 1 ms 2392 KB Output isn't correct
7 Incorrect 1 ms 2392 KB Output isn't 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 Incorrect 1 ms 2392 KB Output isn't correct
16 Incorrect 10 ms 3084 KB Output isn't correct
17 Incorrect 7 ms 2844 KB Output isn't correct
18 Incorrect 8 ms 2840 KB Output isn't correct
19 Incorrect 8 ms 2832 KB Output isn't correct
20 Incorrect 6 ms 2828 KB Output isn't correct
21 Incorrect 29 ms 3996 KB Output isn't correct
22 Incorrect 30 ms 3988 KB Output isn't correct
23 Incorrect 30 ms 3996 KB Output isn't correct
24 Incorrect 35 ms 3988 KB Output isn't correct
25 Incorrect 26 ms 3984 KB Output isn't correct
26 Incorrect 29 ms 3996 KB Output isn't correct
27 Incorrect 31 ms 3868 KB Output isn't correct
28 Incorrect 30 ms 3824 KB Output isn't correct
29 Incorrect 31 ms 3884 KB Output isn't correct
30 Incorrect 24 ms 3996 KB Output isn't correct
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 1 ms 2392 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2392 KB Output isn't correct
2 Incorrect 1 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 Incorrect 1 ms 2392 KB Output isn't correct
6 Incorrect 1 ms 2392 KB Output isn't correct
7 Incorrect 1 ms 2392 KB Output isn't correct
8 Incorrect 0 ms 2392 KB Output isn't correct
9 Incorrect 1 ms 2392 KB Output isn't correct
10 Incorrect 1 ms 2604 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 Incorrect 1 ms 2392 KB Output isn't correct
16 Incorrect 8 ms 2836 KB Output isn't correct
17 Incorrect 8 ms 2840 KB Output isn't correct
18 Incorrect 7 ms 2844 KB Output isn't correct
19 Incorrect 8 ms 2816 KB Output isn't correct
20 Incorrect 6 ms 2824 KB Output isn't correct
21 Incorrect 30 ms 3988 KB Expected int32, but "2500100000" found
22 Incorrect 35 ms 3996 KB Expected int32, but "2500100000" found
23 Incorrect 29 ms 3984 KB Expected int32, but "2500100000" found
24 Incorrect 29 ms 3984 KB Expected int32, but "2500100000" found
25 Incorrect 29 ms 3992 KB Expected int32, but "2500100000" found
26 Incorrect 30 ms 3992 KB Expected int32, but "2500100000" found
27 Incorrect 29 ms 3832 KB Expected int32, but "2500100000" found
28 Incorrect 29 ms 3992 KB Expected int32, but "2500100000" found
29 Incorrect 29 ms 3988 KB Expected int32, but "2500100000" found
30 Incorrect 25 ms 3992 KB Expected int32, but "2500100000" found
31 Incorrect 0 ms 2392 KB Output isn't correct
32 Incorrect 1 ms 2392 KB Output isn't correct