| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1260173 | Szymon_Pilipczuk | Gap (APIO16_gap) | C++20 | 40 ms | 1096 KiB |
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rep(a,b) for(int a = 0;a<b;a++)
const int inf = 1e9;
const ll infl = 1e18;
ll findGap(int t,int n)
{
if(t == 2)
{
ll ans = 0;
ll a,b;
MinMax(0LL,infl,&a,&b);
ll minans = (b-a + n-2)/(n-1);
ll prev = a;
for(ll i = a+1;i<b;i += minans+1)
{
ll c,d;
MinMax(i,min(i+minans,b-1),&c,&d);
if(c == -1) continue;
ans = max(ans,c-prev);
prev = d;
}
ans = max(ans,b-prev);
return ans;
}
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
