| Task: | Gerbil's run |
| Sender: | Sold days |
| Submission time: | 2024-11-16 15:53:58 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | RUNTIME ERROR |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | details |
| #2 | ACCEPTED | 0.00 s | details |
| #3 | ACCEPTED | 0.00 s | details |
| #4 | RUNTIME ERROR | 0.00 s | details |
| #5 | RUNTIME ERROR | 0.00 s | details |
| #6 | RUNTIME ERROR | 0.00 s | details |
| #7 | RUNTIME ERROR | 0.00 s | details |
| #8 | ACCEPTED | 0.00 s | details |
| #9 | ACCEPTED | 0.00 s | details |
| #10 | ACCEPTED | 0.00 s | details |
| #11 | RUNTIME ERROR | 0.00 s | details |
| #12 | RUNTIME ERROR | 0.00 s | details |
| #13 | RUNTIME ERROR | 0.00 s | details |
| #14 | RUNTIME ERROR | 0.00 s | details |
| #15 | ACCEPTED | 0.00 s | details |
| #16 | ACCEPTED | 0.00 s | details |
| #17 | ACCEPTED | 0.00 s | details |
| #18 | RUNTIME ERROR | 0.00 s | details |
| #19 | RUNTIME ERROR | 0.00 s | details |
| #20 | RUNTIME ERROR | 0.00 s | details |
| #21 | ACCEPTED | 0.00 s | details |
| #22 | RUNTIME ERROR | 0.00 s | details |
| #23 | ACCEPTED | 0.00 s | details |
| #24 | ACCEPTED | 0.00 s | details |
| #25 | ACCEPTED | 0.00 s | details |
| #26 | ACCEPTED | 0.00 s | details |
| #27 | ACCEPTED | 0.00 s | details |
| #28 | RUNTIME ERROR | 0.00 s | details |
| #29 | RUNTIME ERROR | 0.00 s | details |
| #30 | RUNTIME ERROR | 0.00 s | details |
| #31 | ACCEPTED | 0.00 s | details |
| #32 | ACCEPTED | 0.00 s | details |
| #33 | RUNTIME ERROR | 0.00 s | details |
| #34 | RUNTIME ERROR | 0.00 s | details |
| #35 | RUNTIME ERROR | 0.00 s | details |
| #36 | ACCEPTED | 0.00 s | details |
| #37 | ACCEPTED | 0.00 s | details |
| #38 | ACCEPTED | 0.00 s | details |
| #39 | RUNTIME ERROR | 0.00 s | details |
| #40 | ACCEPTED | 0.00 s | details |
| #41 | ACCEPTED | 0.01 s | details |
| #42 | ACCEPTED | 0.01 s | details |
| #43 | ACCEPTED | 0.00 s | details |
| #44 | ACCEPTED | 0.01 s | details |
| #45 | WRONG ANSWER | 0.01 s | details |
Code
#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using ll = long long;
const ld PI = M_PI;
const ll mult = 400000;
const int range = 100;
ld r = 0;
ld totalLen = 0;
bool check(ld alpha) {
if (alpha < 0 || alpha >= 1)
return false;
ld x = (2 * PI * r) / (1 + alpha);
return (ll)x % 2 == 0;
}
pair<ll, ll> getAlpha() {
if (check(0)) {
return {0, 1};
}
ld x = floor(totalLen);
ld b = totalLen - x;
ld alphaStart = (totalLen) / (totalLen + b + 1) - 1;
ll enumer = (ll)(alphaStart * mult);
for (ll alphaEnum = enumer - range; alphaEnum < enumer + range; ++alphaEnum) {
if (check((ld)alphaEnum / mult)) {
return {alphaEnum, mult};
}
}
assert(false);
return {0, 0};
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin >> r;
totalLen = (2 * PI * r);
auto alpha = getAlpha();
pair<ll, ll> len = {alpha.first + alpha.second, alpha.second};
pair<ll, ll> prev = {0, len.second};
pair<ll, ll> pos = {len.first, len.second};
while((ld)pos.first / pos.second < totalLen) {
cout << prev.first << '/' << prev.second << ' ' << pos.first << '/' << pos.second << '\n';
pos.first += len.first;
prev = pos;
pos.first += len.first;
}
return 0;
}Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 1 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 2 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 3 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 4
Verdict: RUNTIME ERROR
| input |
|---|
| 4 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| 5 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 6
Verdict: RUNTIME ERROR
| input |
|---|
| 6 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 7
Verdict: RUNTIME ERROR
| input |
|---|
| 7 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 8
Verdict: ACCEPTED
| input |
|---|
| 8 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 9
Verdict: ACCEPTED
| input |
|---|
| 9 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 10
Verdict: ACCEPTED
| input |
|---|
| 10 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 11
Verdict: RUNTIME ERROR
| input |
|---|
| 11 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 12
Verdict: RUNTIME ERROR
| input |
|---|
| 12 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 13
Verdict: RUNTIME ERROR
| input |
|---|
| 13 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 14
Verdict: RUNTIME ERROR
| input |
|---|
| 14 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 15
Verdict: ACCEPTED
| input |
|---|
| 15 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 16
Verdict: ACCEPTED
| input |
|---|
| 16 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 17
Verdict: ACCEPTED
| input |
|---|
| 17 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 18
Verdict: RUNTIME ERROR
| input |
|---|
| 18 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 19
Verdict: RUNTIME ERROR
| input |
|---|
| 19 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 20
Verdict: RUNTIME ERROR
| input |
|---|
| 20 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 21
Verdict: ACCEPTED
| input |
|---|
| 50 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 22
Verdict: RUNTIME ERROR
| input |
|---|
| 98 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 23
Verdict: ACCEPTED
| input |
|---|
| 99 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 24
Verdict: ACCEPTED
| input |
|---|
| 100 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 25
Verdict: ACCEPTED
| input |
|---|
| 101 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 26
Verdict: ACCEPTED
| input |
|---|
| 102 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 27
Verdict: ACCEPTED
| input |
|---|
| 158 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 28
Verdict: RUNTIME ERROR
| input |
|---|
| 159 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 29
Verdict: RUNTIME ERROR
| input |
|---|
| 160 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 30
Verdict: RUNTIME ERROR
| input |
|---|
| 161 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 31
Verdict: ACCEPTED
| input |
|---|
| 313 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 32
Verdict: ACCEPTED
| input |
|---|
| 314 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 33
Verdict: RUNTIME ERROR
| input |
|---|
| 315 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 34
Verdict: RUNTIME ERROR
| input |
|---|
| 316 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 35
Verdict: RUNTIME ERROR
| input |
|---|
| 317 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 36
Verdict: ACCEPTED
| input |
|---|
| 318 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 37
Verdict: ACCEPTED
| input |
|---|
| 319 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 38
Verdict: ACCEPTED
| input |
|---|
| 320 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 39
Verdict: RUNTIME ERROR
| input |
|---|
| 500 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| (empty) |
Error:
code: input/code.cpp:37: std::pair<long long int, long long int> getAlpha(): Assertion `false' failed.
Test 40
Verdict: ACCEPTED
| input |
|---|
| 990 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 41
Verdict: ACCEPTED
| input |
|---|
| 996 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 42
Verdict: ACCEPTED
| input |
|---|
| 997 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 43
Verdict: ACCEPTED
| input |
|---|
| 998 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 44
Verdict: ACCEPTED
| input |
|---|
| 999 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/1 1/1 2/1 3/1 4/1 5/1 6/1 7/1 8/1 9/1 ... |
Test 45
Verdict: WRONG ANSWER
| input |
|---|
| 1000 |
| correct output |
|---|
| 0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
| user output |
|---|
| 0/400000 400012/400000 800024/400000 1200036/400000 1600048/400000 2000060/400000 2400072/400000 2800084/400000 3200096/400000 3600108/400000 ... |
