Task: | Gerbil's run |
Sender: | Sold days |
Submission time: | 2024-11-16 16:23:43 +0200 |
Language: | C++ (C++20) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | ACCEPTED | 0.00 s | details |
#3 | ACCEPTED | 0.00 s | details |
#4 | WRONG ANSWER | 0.01 s | details |
#5 | WRONG ANSWER | 0.01 s | details |
#6 | WRONG ANSWER | 0.01 s | details |
#7 | WRONG ANSWER | 0.02 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | WRONG ANSWER | 0.01 s | details |
#12 | WRONG ANSWER | 0.01 s | details |
#13 | WRONG ANSWER | 0.01 s | details |
#14 | WRONG ANSWER | 0.01 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
#18 | WRONG ANSWER | 0.01 s | details |
#19 | WRONG ANSWER | 0.01 s | details |
#20 | WRONG ANSWER | 0.01 s | details |
#21 | ACCEPTED | 0.00 s | details |
#22 | WRONG ANSWER | 0.01 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 | WRONG ANSWER | 0.01 s | details |
#29 | WRONG ANSWER | 0.01 s | details |
#30 | WRONG ANSWER | 0.01 s | details |
#31 | ACCEPTED | 0.00 s | details |
#32 | ACCEPTED | 0.00 s | details |
#33 | WRONG ANSWER | 0.01 s | details |
#34 | WRONG ANSWER | 0.01 s | details |
#35 | WRONG ANSWER | 0.01 s | details |
#36 | ACCEPTED | 0.00 s | details |
#37 | ACCEPTED | 0.00 s | details |
#38 | ACCEPTED | 0.00 s | details |
#39 | WRONG ANSWER | 0.01 s | details |
#40 | ACCEPTED | 0.00 s | details |
#41 | ACCEPTED | 0.00 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 = 1000000; const int range = 300000; ld r = 0; ld totalLen = 0; ld eps = 1e-11; bool check(ld alpha, ld extra) { if (alpha < 0 || alpha + extra + eps >= 1) return false; ld x = totalLen / (1 + alpha); if ((ll)x % 2 == 1) { return false; } if (alpha + totalLen - x + eps >= 1) { return false; } return true; } pair<pair<ll, ll>, pair<ll, ll>> getAlpha() { if (check(0, 0)) { return {{0, 2}, {0, 2}}; } vector<pair<ll, ll>> extras = {{0, 2}, {1, 4}, {1, 2}, {3, 4}}; for (auto extra : extras) { totalLen -= (ld)extra.first / extra.second; 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, (ld)extra.first / extra.second)) { return {{alphaEnum, mult}, extra}; } } enumer = 0; for (ll alphaEnum = enumer - range; alphaEnum < enumer + range; ++alphaEnum) { if (check((ld)alphaEnum / mult, (ld)extra.first / extra.second)) { return {{alphaEnum, mult}, extra}; } } totalLen += (ld)extra.first / extra.second; } assert(false); return {{0, 0}, {0, 0}}; } int main() { ios::sync_with_stdio(false); cin.tie(0); // for (int r1 = 1; r1 < 1001; ++r1) { // cout << r1 << "\n"; // r = r1; // totalLen = (2 * PI * r); // auto alpha = getAlpha(); // } cin >> r; totalLen = (2 * PI * r); auto [alpha, extra] = 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}; int i = 0; while ((ld)pos.first / pos.second < totalLen) { cout << prev.first << '/' << prev.second << ' ' << pos.first << '/' << pos.second << '\n'; ++i; pos.first += len.first; prev = pos; if (i == 1) { pos.first += extra.first * (pos.second / extra.second); } 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/2 2/2 4/2 6/2 8/2 10/2 |
Test 2
Verdict: ACCEPTED
input |
---|
2 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 3
Verdict: ACCEPTED
input |
---|
3 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 4
Verdict: WRONG ANSWER
input |
---|
4 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1005310/1000000 2010620/1000000 3015930/100000... |
Test 5
Verdict: WRONG ANSWER
input |
---|
5 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1013417/1000000 2026834/1000000 3040251/100000... |
Test 6
Verdict: WRONG ANSWER
input |
---|
6 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1018895/1000000 2037790/1000000 3056685/100000... |
Test 7
Verdict: WRONG ANSWER
input |
---|
7 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1017031/1000000 2034062/1000000 3301093/100000... |
Test 8
Verdict: ACCEPTED
input |
---|
8 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 9
Verdict: ACCEPTED
input |
---|
9 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 10
Verdict: ACCEPTED
input |
---|
10 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 11
Verdict: WRONG ANSWER
input |
---|
11 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1001668/1000000 2003336/1000000 3005004/100000... |
Test 12
Verdict: WRONG ANSWER
input |
---|
12 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1005310/1000000 2010620/1000000 3015930/100000... |
Test 13
Verdict: WRONG ANSWER
input |
---|
13 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1008413/1000000 2016826/1000000 3025239/100000... |
Test 14
Verdict: WRONG ANSWER
input |
---|
14 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1011088/1000000 2022176/1000000 3033264/100000... |
Test 15
Verdict: ACCEPTED
input |
---|
15 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 16
Verdict: ACCEPTED
input |
---|
16 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 17
Verdict: ACCEPTED
input |
---|
17 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 18
Verdict: WRONG ANSWER
input |
---|
18 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1000862/1000000 2001724/1000000 3002586/100000... |
Test 19
Verdict: WRONG ANSWER
input |
---|
19 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1003198/1000000 2006396/1000000 3009594/100000... |
Test 20
Verdict: WRONG ANSWER
input |
---|
20 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1005310/1000000 2010620/1000000 3015930/100000... |
Test 21
Verdict: ACCEPTED
input |
---|
50 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 22
Verdict: WRONG ANSWER
input |
---|
98 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1001224/1000000 2002448/1000000 3003672/100000... |
Test 23
Verdict: ACCEPTED
input |
---|
99 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 24
Verdict: ACCEPTED
input |
---|
100 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 25
Verdict: ACCEPTED
input |
---|
101 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 26
Verdict: ACCEPTED
input |
---|
102 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 27
Verdict: ACCEPTED
input |
---|
158 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 28
Verdict: WRONG ANSWER
input |
---|
159 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1000027/1000000 2000054/1000000 3000081/100000... |
Test 29
Verdict: WRONG ANSWER
input |
---|
160 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1000309/1000000 2000618/1000000 3000927/100000... |
Test 30
Verdict: WRONG ANSWER
input |
---|
161 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1000587/1000000 2001174/1000000 3001761/100000... |
Test 31
Verdict: ACCEPTED
input |
---|
313 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 32
Verdict: ACCEPTED
input |
---|
314 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 33
Verdict: WRONG ANSWER
input |
---|
315 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1000103/1000000 2000206/1000000 3000309/100000... |
Test 34
Verdict: WRONG ANSWER
input |
---|
316 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1000246/1000000 2000492/1000000 3000738/100000... |
Test 35
Verdict: WRONG ANSWER
input |
---|
317 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1000387/1000000 2000774/1000000 3001161/100000... |
Test 36
Verdict: ACCEPTED
input |
---|
318 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 37
Verdict: ACCEPTED
input |
---|
319 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 38
Verdict: ACCEPTED
input |
---|
320 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 39
Verdict: WRONG ANSWER
input |
---|
500 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1000189/1000000 2000378/1000000 3000567/100000... |
Test 40
Verdict: ACCEPTED
input |
---|
990 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 41
Verdict: ACCEPTED
input |
---|
996 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 42
Verdict: ACCEPTED
input |
---|
997 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 43
Verdict: ACCEPTED
input |
---|
998 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 44
Verdict: ACCEPTED
input |
---|
999 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/2 2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 ... |
Test 45
Verdict: WRONG ANSWER
input |
---|
1000 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/1000000 1000030/1000000 2000060/1000000 3000090/100000... |