제출 #366215

#제출 시각아이디문제언어결과실행 시간메모리
366215mathking1021Gap (APIO16_gap)C++17
0 / 100
71 ms3444 KiB
#include "gap.h"
#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

ll t, n;

vector<ll> ve;

long long findGap(int T, int N)
{
    t = T;
    n = N;
    ll a, b;
    MinMax(0LL, 1000000000000000000LL, &a, &b);
    ll c = (b - a + n - 2) / (n - 1);
    ll ans = c;
    for(ll i = a; i <= b - c + 1; i += c)
    {
        ll t3, t4;
        MinMax(i, i + c - 1, &t3, &t4);
        if(t3 != -1)
        {
            ve.push_back(t3);
            ve.push_back(t4);
        }
    }
    for(ll i = 1; i < ve.size(); i++)
    {
        ans = max(ans, ve[i] - ve[i - 1]);
    }
    return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:30:21: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |     for(ll i = 1; i < ve.size(); i++)
      |                   ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...