| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1091026 | Nurislam | Gap (APIO16_gap) | C++17 | 21 ms | 1224 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#include "gap.h"
typedef long long ll;
ll solve1(int t, int n){
ll l = 0, r = 1e18;
vector<ll> a;
ll lf = 1, rf = 1;
while(lf != rf && a.size()*2 < n){
MinMax(l, r, &lf, &rf);
if(lf == -1)break;
a.pb(lf);
a.pb(rf);
l = lf+1, r = rf-1;
}
ll ans = 1;
sort(all(a));
for(int i = 1; i < a.size(); i++)
ans = max(ans, a[i] - a[i-1]);
return ans;
}
long long findGap(int t, int n)
{
//if(t == 1){
return solve1(t, n);
//}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
