Task: | Gerbil's run |
Sender: | Sold days |
Submission time: | 2024-11-16 15:59:44 +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.00 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.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.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.01 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 = 700007; const int range = 50000; 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}; } } enumer = 0; 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; // cout << r << "\n"; 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: WRONG ANSWER
input |
---|
4 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 703724/700007 1407448/700007 2111172/700007 2814896/700007 3518620/700007 4222344/700007 4926068/700007 5629792/700007 6333516/700007 ... |
Test 5
Verdict: WRONG ANSWER
input |
---|
5 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 709399/700007 1418798/700007 2128197/700007 2837596/700007 3546995/700007 4256394/700007 4965793/700007 5675192/700007 6384591/700007 ... |
Test 6
Verdict: WRONG ANSWER
input |
---|
6 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 713234/700007 1426468/700007 2139702/700007 2852936/700007 3566170/700007 4279404/700007 4992638/700007 5705872/700007 6419106/700007 ... |
Test 7
Verdict: WRONG ANSWER
input |
---|
7 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 715999/700007 1431998/700007 2147997/700007 2863996/700007 3579995/700007 4295994/700007 5011993/700007 5727992/700007 6443991/700007 ... |
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: WRONG ANSWER
input |
---|
11 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 701175/700007 1402350/700007 2103525/700007 2804700/700007 3505875/700007 4207050/700007 4908225/700007 5609400/700007 6310575/700007 ... |
Test 12
Verdict: WRONG ANSWER
input |
---|
12 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 703724/700007 1407448/700007 2111172/700007 2814896/700007 3518620/700007 4222344/700007 4926068/700007 5629792/700007 6333516/700007 ... |
Test 13
Verdict: WRONG ANSWER
input |
---|
13 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 705896/700007 1411792/700007 2117688/700007 2823584/700007 3529480/700007 4235376/700007 4941272/700007 5647168/700007 6353064/700007 ... |
Test 14
Verdict: WRONG ANSWER
input |
---|
14 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 707769/700007 1415538/700007 2123307/700007 2831076/700007 3538845/700007 4246614/700007 4954383/700007 5662152/700007 6369921/700007 ... |
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: WRONG ANSWER
input |
---|
18 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 700610/700007 1401220/700007 2101830/700007 2802440/700007 3503050/700007 4203660/700007 4904270/700007 5604880/700007 6305490/700007 ... |
Test 19
Verdict: WRONG ANSWER
input |
---|
19 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 702246/700007 1404492/700007 2106738/700007 2808984/700007 3511230/700007 4213476/700007 4915722/700007 5617968/700007 6320214/700007 ... |
Test 20
Verdict: WRONG ANSWER
input |
---|
20 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 703724/700007 1407448/700007 2111172/700007 2814896/700007 3518620/700007 4222344/700007 4926068/700007 5629792/700007 6333516/700007 ... |
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: WRONG ANSWER
input |
---|
98 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 700864/700007 1401728/700007 2102592/700007 2803456/700007 3504320/700007 4205184/700007 4906048/700007 5606912/700007 6307776/700007 ... |
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: WRONG ANSWER
input |
---|
159 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 700026/700007 1400052/700007 2100078/700007 2800104/700007 3500130/700007 4200156/700007 4900182/700007 5600208/700007 6300234/700007 ... |
Test 29
Verdict: WRONG ANSWER
input |
---|
160 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 700223/700007 1400446/700007 2100669/700007 2800892/700007 3501115/700007 4201338/700007 4901561/700007 5601784/700007 6302007/700007 ... |
Test 30
Verdict: WRONG ANSWER
input |
---|
161 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 700418/700007 1400836/700007 2101254/700007 2801672/700007 3502090/700007 4202508/700007 4902926/700007 5603344/700007 6303762/700007 ... |
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: WRONG ANSWER
input |
---|
315 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 700079/700007 1400158/700007 2100237/700007 2800316/700007 3500395/700007 4200474/700007 4900553/700007 5600632/700007 6300711/700007 ... |
Test 34
Verdict: WRONG ANSWER
input |
---|
316 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 700179/700007 1400358/700007 2100537/700007 2800716/700007 3500895/700007 4201074/700007 4901253/700007 5601432/700007 6301611/700007 ... |
Test 35
Verdict: WRONG ANSWER
input |
---|
317 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 700278/700007 1400556/700007 2100834/700007 2801112/700007 3501390/700007 4201668/700007 4901946/700007 5602224/700007 6302502/700007 ... |
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: WRONG ANSWER
input |
---|
500 |
correct output |
---|
0/1000000 1000000/1000000 2000000/1000000 3000000/100000... |
user output |
---|
0/700007 700140/700007 1400280/700007 2100420/700007 2800560/700007 3500700/700007 4200840/700007 4900980/700007 5601120/700007 6301260/700007 ... |
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/700007 700028/700007 1400056/700007 2100084/700007 2800112/700007 3500140/700007 4200168/700007 4900196/700007 5600224/700007 6300252/700007 ... |