Task: | Gerbil's run |
Sender: | Sold days |
Submission time: | 2024-11-16 16:43:07 +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.00 s | details |
#5 | WRONG ANSWER | 0.00 s | details |
#6 | WRONG ANSWER | 0.00 s | details |
#7 | WRONG ANSWER | 0.00 s | details |
#8 | ACCEPTED | 0.00 s | details |
#9 | ACCEPTED | 0.00 s | details |
#10 | ACCEPTED | 0.00 s | details |
#11 | WRONG ANSWER | 0.00 s | details |
#12 | WRONG ANSWER | 0.00 s | details |
#13 | WRONG ANSWER | 0.00 s | details |
#14 | WRONG ANSWER | 0.00 s | details |
#15 | ACCEPTED | 0.00 s | details |
#16 | ACCEPTED | 0.00 s | details |
#17 | ACCEPTED | 0.00 s | details |
#18 | WRONG ANSWER | 0.00 s | details |
#19 | WRONG ANSWER | 0.01 s | details |
#20 | WRONG ANSWER | 0.00 s | details |
#21 | ACCEPTED | 0.00 s | details |
#22 | WRONG ANSWER | 0.00 s | details |
#23 | ACCEPTED | 0.00 s | details |
#24 | ACCEPTED | 0.01 s | details |
#25 | ACCEPTED | 0.00 s | details |
#26 | ACCEPTED | 0.00 s | details |
#27 | ACCEPTED | 0.00 s | details |
#28 | WRONG ANSWER | 0.00 s | details |
#29 | WRONG ANSWER | 0.00 s | details |
#30 | WRONG ANSWER | 0.00 s | details |
#31 | ACCEPTED | 0.00 s | details |
#32 | ACCEPTED | 0.00 s | details |
#33 | WRONG ANSWER | 0.00 s | details |
#34 | WRONG ANSWER | 0.00 s | details |
#35 | WRONG ANSWER | 0.00 s | details |
#36 | ACCEPTED | 0.00 s | details |
#37 | ACCEPTED | 0.00 s | details |
#38 | ACCEPTED | 0.00 s | details |
#39 | WRONG ANSWER | 0.00 s | details |
#40 | ACCEPTED | 0.00 s | details |
#41 | ACCEPTED | 0.00 s | details |
#42 | ACCEPTED | 0.00 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 = 10000; const int range = 5000; 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; ll x = (ll)floorl(totalLen / (1 + alpha)); if (x % 2 == 1) { return false; } if (alpha + totalLen - (x * (1 + alpha)) + 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 = len; pair<ll, ll> pos = {len.first * 2 + extra.first * (len.second / extra.second), len.second}; // cout << extra.first * (pos.second / extra.second)<< '\n'; // cout << len.first * 2 + extra.first * (pos.second / extra.second)<< '\n'; // cout << pos.second<< '\n'; // cout << (ld)pos.first / pos.second<< '\n'; totalLen = (2 * PI * r); 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 |
---|
2/2 4/2 6/2 8/2 10/2 12/2 |
Test 2
Verdict: ACCEPTED
input |
---|
2 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 3
Verdict: ACCEPTED
input |
---|
3 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 4
Verdict: WRONG ANSWER
input |
---|
4 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10058/10000 20116/10000 30174/10000 40232/10000 50290/10000 60348/10000 70406/10000 80464/10000 90522/10000 100580/10000 ... |
Test 5
Verdict: WRONG ANSWER
input |
---|
5 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10144/10000 20288/10000 30432/10000 40576/10000 50720/10000 60864/10000 71008/10000 81152/10000 91296/10000 101440/10000 ... |
Test 6
Verdict: WRONG ANSWER
input |
---|
6 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10200/10000 20400/10000 30600/10000 40800/10000 51000/10000 61200/10000 71400/10000 81600/10000 91800/10000 102000/10000 ... |
Test 7
Verdict: WRONG ANSWER
input |
---|
7 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10240/10000 20480/10000 30720/10000 40960/10000 51200/10000 61440/10000 71680/10000 81920/10000 92160/10000 102400/10000 ... |
Test 8
Verdict: ACCEPTED
input |
---|
8 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 9
Verdict: ACCEPTED
input |
---|
9 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 10
Verdict: ACCEPTED
input |
---|
10 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 11
Verdict: WRONG ANSWER
input |
---|
11 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10018/10000 20036/10000 30054/10000 40072/10000 50090/10000 60108/10000 70126/10000 80144/10000 90162/10000 100180/10000 ... |
Test 12
Verdict: WRONG ANSWER
input |
---|
12 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10055/10000 20110/10000 30165/10000 40220/10000 50275/10000 60330/10000 70385/10000 80440/10000 90495/10000 100550/10000 ... |
Test 13
Verdict: WRONG ANSWER
input |
---|
13 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10087/10000 20174/10000 30261/10000 40348/10000 50435/10000 60522/10000 70609/10000 80696/10000 90783/10000 100870/10000 ... |
Test 14
Verdict: WRONG ANSWER
input |
---|
14 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10114/10000 20228/10000 30342/10000 40456/10000 50570/10000 60684/10000 70798/10000 80912/10000 91026/10000 101140/10000 ... |
Test 15
Verdict: ACCEPTED
input |
---|
15 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 16
Verdict: ACCEPTED
input |
---|
16 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 17
Verdict: ACCEPTED
input |
---|
17 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 18
Verdict: WRONG ANSWER
input |
---|
18 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10009/10000 20018/10000 30027/10000 40036/10000 50045/10000 60054/10000 70063/10000 80072/10000 90081/10000 100090/10000 ... |
Test 19
Verdict: WRONG ANSWER
input |
---|
19 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10033/10000 20066/10000 30099/10000 40132/10000 50165/10000 60198/10000 70231/10000 80264/10000 90297/10000 100330/10000 ... |
Test 20
Verdict: WRONG ANSWER
input |
---|
20 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10054/10000 20108/10000 30162/10000 40216/10000 50270/10000 60324/10000 70378/10000 80432/10000 90486/10000 100540/10000 ... |
Test 21
Verdict: ACCEPTED
input |
---|
50 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 22
Verdict: WRONG ANSWER
input |
---|
98 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10013/10000 20026/10000 30039/10000 40052/10000 50065/10000 60078/10000 70091/10000 80104/10000 90117/10000 100130/10000 ... |
Test 23
Verdict: ACCEPTED
input |
---|
99 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 24
Verdict: ACCEPTED
input |
---|
100 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 25
Verdict: ACCEPTED
input |
---|
101 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 26
Verdict: ACCEPTED
input |
---|
102 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 27
Verdict: ACCEPTED
input |
---|
158 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 28
Verdict: WRONG ANSWER
input |
---|
159 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10001/10000 20002/10000 30003/10000 40004/10000 50005/10000 60006/10000 70007/10000 80008/10000 90009/10000 100010/10000 ... |
Test 29
Verdict: WRONG ANSWER
input |
---|
160 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10004/10000 20008/10000 30012/10000 40016/10000 50020/10000 60024/10000 70028/10000 80032/10000 90036/10000 100040/10000 ... |
Test 30
Verdict: WRONG ANSWER
input |
---|
161 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10006/10000 20012/10000 30018/10000 40024/10000 50030/10000 60036/10000 70042/10000 80048/10000 90054/10000 100060/10000 ... |
Test 31
Verdict: ACCEPTED
input |
---|
313 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 32
Verdict: ACCEPTED
input |
---|
314 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 33
Verdict: WRONG ANSWER
input |
---|
315 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10002/10000 20004/10000 30006/10000 40008/10000 50010/10000 60012/10000 70014/10000 80016/10000 90018/10000 100020/10000 ... |
Test 34
Verdict: WRONG ANSWER
input |
---|
316 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10003/10000 20006/10000 30009/10000 40012/10000 50015/10000 60018/10000 70021/10000 80024/10000 90027/10000 100030/10000 ... |
Test 35
Verdict: WRONG ANSWER
input |
---|
317 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10004/10000 20008/10000 30012/10000 40016/10000 50020/10000 60024/10000 70028/10000 80032/10000 90036/10000 100040/10000 ... |
Test 36
Verdict: ACCEPTED
input |
---|
318 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 37
Verdict: ACCEPTED
input |
---|
319 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 38
Verdict: ACCEPTED
input |
---|
320 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 39
Verdict: WRONG ANSWER
input |
---|
500 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10002/10000 20004/10000 30006/10000 40008/10000 50010/10000 60012/10000 70014/10000 80016/10000 90018/10000 100020/10000 ... |
Test 40
Verdict: ACCEPTED
input |
---|
990 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 41
Verdict: ACCEPTED
input |
---|
996 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 42
Verdict: ACCEPTED
input |
---|
997 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 43
Verdict: ACCEPTED
input |
---|
998 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 44
Verdict: ACCEPTED
input |
---|
999 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
2/2 4/2 6/2 8/2 10/2 12/2 14/2 16/2 18/2 20/2 ... |
Test 45
Verdict: WRONG ANSWER
input |
---|
1000 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
10001/10000 20002/10000 30003/10000 40004/10000 50005/10000 60006/10000 70007/10000 80008/10000 90009/10000 100010/10000 ... |