| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1339837 | thesentro | Hack (APIO25_hack) | C++20 | 81 ms | 428 KiB |
#include "hack.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll gcd(ll x, ll y)
{
if (y==0)
return x;
return gcd(y, x%y);
}
int hack(){
// std::vector<long long> x = {1, 2, 3};
// long long a = collisions(x);
// long long b = collisions({92, 65});
ll g = 0;
for (int i=1e6 ; i>502000 ; i--)
{
ll val = i;
ll l = 1e6+1;
ll r = l+i;
if (collisions({l, r})==0) continue;
g = i;
for (int j=1 ; j<=sqrt(i) ; j++)
{
if (i%j==0)
{
if (collisions({1000001, 1000001+j})>0)
g = gcd(g, j);
if (collisions({1000001, 1000001+i/j})>0)
g = gcd(g, i/j);
}
}
return g;
}
for (int i=502000 ; i>500000 ; i--)
{
if (collisions({1000001, 1000001+i})>0)
{
return i;
}
}
}컴파일 시 표준 에러 (stderr) 메시지
| # | 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... | ||||
