답안 #946685

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
946685 2024-03-14T22:16:33 Z Ice_man Gap (APIO16_gap) C++14
0 / 100
31 ms 4392 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 = LINF;

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

    return ans;
}


/**int main()
{
    int t , n;
    cin >> t >> n;
    findGap(t , n);

    return 0;
}*/



# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Incorrect 0 ms 2392 KB Output isn't correct
3 Incorrect 0 ms 2392 KB Output isn't correct
4 Incorrect 0 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 0 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 8 ms 2848 KB Output isn't correct
17 Incorrect 8 ms 2828 KB Output isn't correct
18 Incorrect 8 ms 2992 KB Output isn't correct
19 Incorrect 8 ms 2840 KB Output isn't correct
20 Incorrect 6 ms 2832 KB Output isn't correct
21 Incorrect 30 ms 4392 KB Output isn't correct
22 Incorrect 29 ms 3856 KB Output isn't correct
23 Incorrect 30 ms 4240 KB Output isn't correct
24 Incorrect 31 ms 3984 KB Output isn't correct
25 Incorrect 26 ms 3988 KB Output isn't correct
26 Incorrect 29 ms 3996 KB Output isn't correct
27 Incorrect 29 ms 3992 KB Output isn't correct
28 Incorrect 29 ms 3992 KB Output isn't correct
29 Incorrect 31 ms 3980 KB Output isn't correct
30 Incorrect 25 ms 3984 KB Output isn't correct
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 0 ms 2392 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2392 KB Output isn't correct
2 Incorrect 1 ms 2392 KB Output isn't correct
3 Incorrect 0 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 1 ms 2592 KB Output isn't correct
9 Incorrect 1 ms 2644 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 8 ms 2836 KB Output isn't correct
17 Incorrect 10 ms 2840 KB Output isn't correct
18 Incorrect 9 ms 2840 KB Output isn't correct
19 Incorrect 8 ms 2844 KB Output isn't correct
20 Incorrect 6 ms 2812 KB Output isn't correct
21 Incorrect 30 ms 3996 KB Expected int32, but "2500100000" found
22 Incorrect 30 ms 3988 KB Expected int32, but "2500100000" found
23 Incorrect 29 ms 4044 KB Expected int32, but "2500100000" found
24 Incorrect 30 ms 3816 KB Expected int32, but "2500100000" found
25 Incorrect 26 ms 3992 KB Expected int32, but "2500100000" found
26 Incorrect 29 ms 3996 KB Expected int32, but "2500100000" found
27 Incorrect 30 ms 4020 KB Expected int32, but "2500100000" found
28 Incorrect 29 ms 3992 KB Expected int32, but "2500100000" found
29 Incorrect 29 ms 3992 KB Expected int32, but "2500100000" found
30 Incorrect 24 ms 3984 KB Expected int32, but "2500100000" found
31 Incorrect 1 ms 2392 KB Output isn't correct
32 Incorrect 1 ms 2392 KB Output isn't correct