| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 199474 | SamAnd | Lutrija (COCI19_lutrija) | C++17 | 203 ms | 504 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
bool stgg(long long x)
{
if (x <= 1)
return false;
for (long long i = 2; i * i <= x; ++i)
{
if (x % i == 0)
return false;
}
return true;
}
bool stg(const vector<long long>& v)
{
for (int i = 0; i < v.size() - 1; ++i)
{
if (!stgg(v[i]))
return false;
if (!stgg(abs(v[i + 1] - v[i])))
return false;
}
return true;
}
int main()
{
long long a, b;
scanf("%lld%lld", &a, &b);
if (stg({a, b}))
{
printf("2\n%lld %lld\n", a, b);
return 0;
}
if (stg({a, 2, b}))
{
printf("3\n%lld %lld %lld\n", a, 2, b);
return 0;
}
if (a == 2)
{
if (stg({a, b + 2, b}))
{
printf("3\n%lld %lld %lld\n", a, b + 2, b);
return 0;
}
if (stg({a, b - 2, b}))
{
printf("3\n%lld %lld %lld\n", a, b - 2, b);
return 0;
}
}
if (b == 2)
{
if (stg({a, a + 2, b}))
{
printf("3\n%lld %lld %lld\n", a, a + 2, b);
return 0;
}
if (stg({a, a - 2, b}))
{
printf("3\n%lld %lld %lld\n", a, a - 2, b);
return 0;
}
}
printf("-1\n");
return 0;
}
컴파일 시 표준 에러 (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... | ||||
| # | 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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
