이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PUB push_back
vector<ll>data;
ll subtask1(int N){
ll l = 0,
r = 1e18;
ll respL, respR;
ll ans = 0;
while(data.size() < N){
MinMax(l, r, &respL, &respR);
l = respL+1;
r = respR-1;
data.PUB(respL);
if(respL != respR) data.PUB(respR);
}
sort(data.begin(), data.end());
for(int i=0;i<N-1;i++){
ans = max(ans, data[i+1]-data[i]);
}
return ans;
}
long long findGap(int T, int N)
{
if(T==1) return subtask1(N);
else return subtask1(N);
}
컴파일 시 표준 에러 (stderr) 메시지
gap.cpp: In function 'll subtask1(int)':
gap.cpp:17:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while(data.size() < N){
~~~~~~~~~~~~^~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |