이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <stdio.h>
#include <vector>
#include "gap.h"
using namespace std;
typedef long long llong;
llong solveSmall(int N)
{
    llong minVal, maxVal;
    llong L = 0, R = 1000000000000000000LL;
    int pL = 0, pR = N - 1;
    vector<llong> nums(N);
    while(pL <= pR)
    {
        MinMax(L, R, &minVal, &maxVal);
        nums[pL] = minVal;
        nums[pR] = maxVal;
        pL++;
        pR--;
        L = minVal + 1;
        R = maxVal - 1;
    }
    llong ans = 0;
    for (int i = 1; i < nums.size(); i++)
    {
        ans = max(ans, nums[i] - nums[i - 1]);
    }
    return ans;
}
llong solveBig(int N)
{
    return 0LL;
}
llong findGap(int T, int N)
{
    if (T == 1)
        return solveSmall(N);
    else
        return solveBig(N);
}
/*
int main()
{
}
*/
컴파일 시 표준 에러 (stderr) 메시지
gap.cpp: In function 'llong solveSmall(int)':
gap.cpp:29:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |     for (int i = 1; i < nums.size(); i++)
      |                     ~~^~~~~~~~~~~~~| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |