| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1327953 | idonoam | Hack (APIO25_hack) | C++20 | 11 ms | 1264 KiB |
#include "hack.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll isbet(ll a, ll b)
{
ll c = (ll)sqrt(b - a);
vector<ll> vec;
for (ll i = 1; i <= c; i++)
{
vec.push_back(i);
}
for (ll i = max(a, c) + c; i <= b; i += c)
{
vec.push_back(i);
}
vec.push_back(b+1);
return collisions(vec);
}
int hack()
{
ll mx = 1e9;
ll mn = 1;
while (mx > mn + 7)
{
ll c = (mx + mn) / 2;
if (isbet(mn,c))
{
mx =c;
}
else
{
mn = c + 1;
}
}
for (ll i = mn; i < mx; i+=2)
if (collisions({1, 1 + i * (i + 1)}))
{
if (collisions({1, 1 + i}))
return i;
return i + 1;
}
return mx;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
