Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
B'You are given a positive integer n . Find a sequence of fractions frac{a_i}{b_i} , i = 1 ldots k (where a_i and b_i are positive integers) for some k such that: begin{cases} text{$b_i$ divides $n$, $1 < b_i < n$ for $i = 1 ldots k$} text{$1 <= a_i < b_i$ for $i = 1 ldots k$} text{$ sum limits_{i=1}^k frac{a_i}{b_i} = 1 - frac{1}{n}$} end{cases} The input consists of a single integer n ( 2 <= n <= 10^9 ). In the first line print "YES" if there exists such a sequence of fractions or "NO" otherwise. If there exists such a sequence, next lines should contain a description of the sequence in the following format. The second line should contain integer k ( 1 <= k <= 100 ,000 ) -- the number of elements in the sequence. It is guaranteed that if such a sequence exists, then there exists a sequence of length at most 100 ,000 . Next k lines should contain fractions of the sequence with two integers a_i and b_i on each line. In the second example there is a sequence frac{1}{2}, frac{1}{3} such that frac{1}{2} + frac{1}{3} = 1 - frac{1}{6} . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
46640034 |
psaini |
F |
Dec. 5, 2018, 9:04 a.m. |
OK |
GNU C11 |
TESTS |
62 |
31 |
0 |
|
2000 |
53708733 |
vjudge5 |
F |
May 3, 2019, 2:30 p.m. |
OK |
GNU C11 |
TESTS |
62 |
31 |
0 |
|
2000 |
53781547 |
luogu_bot5 |
F |
May 5, 2019, 9:07 a.m. |
OK |
GNU C11 |
TESTS |
62 |
31 |
0 |
|
2000 |
54054893 |
vjudge5 |
F |
May 13, 2019, 7:29 a.m. |
OK |
GNU C11 |
TESTS |
62 |
31 |
0 |
|
2000 |
46509614 |
Sempr |
F |
Dec. 2, 2018, 12:41 p.m. |
OK |
GNU C11 |
TESTS |
62 |
31 |
0 |
|
2000 |
46740960 |
quintessence BUAAduhao zlc1114 |
F |
Dec. 8, 2018, 2:24 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
30 |
0 |
|
2000 |
46740926 |
MistyBlue |
F |
Dec. 8, 2018, 2:22 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
30 |
0 |
|
2000 |
53842478 |
vjudge4 |
F |
May 7, 2019, 8:28 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
30 |
0 |
|
2000 |
46477853 |
nianheng shanxizeng |
F |
Dec. 2, 2018, 8:27 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
30 |
0 |
|
2000 |
59930901 |
just_soso crawarb |
F |
Sept. 3, 2019, 7:10 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
31 |
0 |
|
2000 |
59977508 |
just_soso |
F |
Sept. 4, 2019, 6:41 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
31 |
0 |
|
2000 |
59977591 |
just_soso |
F |
Sept. 4, 2019, 6:44 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
31 |
0 |
|
2000 |
59977884 |
just_soso |
F |
Sept. 4, 2019, 6:53 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
31 |
0 |
|
2000 |
59977891 |
just_soso |
F |
Sept. 4, 2019, 6:53 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
31 |
0 |
|
2000 |
61697230 |
w_57 ws_syx |
F |
Oct. 2, 2019, 7:19 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
31 |
0 |
|
2000 |
47030738 |
IvL |
F |
Dec. 15, 2018, 9:37 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
15 |
0 |
|
2000 |
47819286 |
krijgertje |
F |
Jan. 1, 2019, 4:34 p.m. |
OK |
GNU C++14 |
TESTS |
62 |
15 |
204800 |
|
2000 |
47874226 |
Gazelle_ w_t |
F |
Jan. 3, 2019, 2:27 p.m. |
OK |
GNU C++14 |
TESTS |
62 |
30 |
0 |
|
2000 |
47874012 |
Silvio_Manuel |
F |
Jan. 3, 2019, 2:21 p.m. |
OK |
GNU C++14 |
TESTS |
62 |
30 |
0 |
|
2000 |
46915564 |
masonsbro ryanr1230 mIXs |
F |
Dec. 11, 2018, 8:05 p.m. |
OK |
GNU C++14 |
TESTS |
62 |
30 |
0 |
|
2000 |
51300096 |
tabasz znirzej |
F |
March 14, 2019, 2:02 p.m. |
OK |
GNU C++14 |
TESTS |
62 |
30 |
0 |
|
2000 |
48044653 |
xyz111 ksun48 ecnerwala |
F |
Jan. 7, 2019, 12:27 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
30 |
0 |
|
2000 |
55219327 |
Black.n.White |
F |
June 6, 2019, 6:33 p.m. |
OK |
GNU C++14 |
TESTS |
62 |
30 |
0 |
|
2000 |
52904771 |
aniKet_gAjare |
F |
April 17, 2019, 12:18 p.m. |
OK |
GNU C++14 |
TESTS |
62 |
30 |
0 |
|
2000 |
52560526 |
LowR |
F |
April 10, 2019, 10:07 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
30 |
0 |
|
2000 |
46957576 |
Lucina |
F |
Dec. 13, 2018, 5:41 a.m. |
OK |
GNU C++17 |
TESTS |
62 |
15 |
0 |
|
2000 |
47468600 |
T_BONE_289 |
F |
Dec. 24, 2018, 8:03 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
15 |
102400 |
|
2000 |
46716520 |
asdfghjkl21 |
F |
Dec. 7, 2018, 11:31 a.m. |
OK |
GNU C++17 |
TESTS |
62 |
30 |
0 |
|
2000 |
46700029 |
Igorjan94 |
F |
Dec. 7, 2018, 12:47 a.m. |
OK |
GNU C++17 |
TESTS |
62 |
30 |
0 |
|
2000 |
46585652 |
Infinity10K |
F |
Dec. 4, 2018, 1:08 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
30 |
0 |
|
2000 |
65816452 |
Um_nik KAN |
F |
Nov. 27, 2019, 9:38 a.m. |
OK |
GNU C++17 |
TESTS |
62 |
30 |
0 |
|
2000 |
57276362 |
himanshu |
F |
July 18, 2019, 11 a.m. |
OK |
GNU C++17 |
TESTS |
62 |
30 |
0 |
|
2000 |
46902021 |
subbu Praneet100 nishank.suresh |
F |
Dec. 11, 2018, 12:26 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
30 |
0 |
|
2000 |
47813631 |
CoDeRoK |
F |
Jan. 1, 2019, 12:59 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
30 |
0 |
|
2000 |
46745625 |
vjudge1 |
F |
Dec. 8, 2018, 6:37 a.m. |
OK |
GNU C++17 |
TESTS |
62 |
30 |
0 |
|
2000 |
46508341 |
its_ulure souradeep.99 codingalways |
F |
Dec. 2, 2018, 12:04 p.m. |
OK |
Java 8 |
TESTS |
62 |
109 |
0 |
|
2000 |
47447952 |
sindhu504 |
F |
Dec. 24, 2018, 7:39 a.m. |
OK |
Java 8 |
TESTS |
62 |
109 |
0 |
|
2000 |
46670343 |
BaZ_ prasun123 aashrayagarwal |
F |
Dec. 6, 2018, 6:12 a.m. |
OK |
Java 8 |
TESTS |
62 |
109 |
0 |
|
2000 |
46479573 |
fetetriste mipt.vi002 |
F |
Dec. 2, 2018, 8:41 a.m. |
OK |
Java 8 |
TESTS |
62 |
109 |
0 |
|
2000 |
46472168 |
eatmore |
F |
Dec. 2, 2018, 7:42 a.m. |
OK |
Java 8 |
TESTS |
62 |
109 |
0 |
|
2000 |
64799187 |
iakovlev.zakhar sharepoLOVEDDD golikovnik |
F |
Nov. 13, 2019, 1:59 p.m. |
OK |
Java 8 |
TESTS |
62 |
124 |
0 |
|
2000 |
49659167 |
wadissimo |
F |
Feb. 9, 2019, 11:31 a.m. |
OK |
Java 8 |
TESTS |
62 |
124 |
0 |
|
2000 |
46899249 |
spar5h Jeel_Vaishnav Yash23 |
F |
Dec. 11, 2018, 11:04 a.m. |
OK |
Java 8 |
TESTS |
62 |
124 |
0 |
|
2000 |
46496954 |
poikniok |
F |
Dec. 2, 2018, 10:21 a.m. |
OK |
Java 8 |
TESTS |
62 |
124 |
0 |
|
2000 |
46485353 |
sarthakmanna avijit_agarwal meooow |
F |
Dec. 2, 2018, 9:23 a.m. |
OK |
Java 8 |
TESTS |
62 |
124 |
0 |
|
2000 |
46489856 |
moss3s |
F |
Dec. 2, 2018, 9:49 a.m. |
OK |
Kotlin |
TESTS |
62 |
124 |
0 |
|
2000 |
46489787 |
moss3s |
F |
Dec. 2, 2018, 9:48 a.m. |
OK |
Kotlin |
TESTS |
62 |
951 |
0 |
|
2000 |
46940003 |
omikad |
F |
Dec. 12, 2018, 4:01 p.m. |
OK |
Mono C# |
TESTS |
62 |
46 |
0 |
|
2000 |
64661517 |
gsvana13 |
F |
Nov. 10, 2019, 9:15 p.m. |
OK |
Mono C# |
TESTS |
62 |
62 |
0 |
|
2000 |
46485184 |
BrainFreeze peregrinus |
F |
Dec. 2, 2018, 9:19 a.m. |
OK |
Mono C# |
TESTS |
62 |
62 |
68915200 |
|
2000 |
53785884 |
vjudge4 |
F |
May 5, 2019, 10:03 a.m. |
OK |
MS C++ |
TESTS |
62 |
30 |
0 |
|
2000 |
53460534 |
vjudge2 |
F |
April 28, 2019, 6:55 a.m. |
OK |
MS C++ |
TESTS |
62 |
31 |
0 |
|
2000 |
51351235 |
Kroete |
F |
March 15, 2019, 10:12 p.m. |
OK |
MS C++ |
TESTS |
62 |
31 |
0 |
|
2000 |
46747999 |
Miris |
F |
Dec. 8, 2018, 7:49 a.m. |
OK |
MS C++ |
TESTS |
62 |
31 |
0 |
|
2000 |
53472733 |
vjudge4 |
F |
April 28, 2019, 1:39 p.m. |
OK |
MS C++ |
TESTS |
62 |
31 |
0 |
|
2000 |
53462027 |
vjudge1 |
F |
April 28, 2019, 7:50 a.m. |
OK |
MS C++ |
TESTS |
62 |
31 |
0 |
|
2000 |
53495217 |
vjudge2 |
F |
April 29, 2019, 11:23 a.m. |
OK |
MS C++ |
TESTS |
62 |
31 |
0 |
|
2000 |
48703977 |
Timonnable |
F |
Jan. 22, 2019, 4:52 a.m. |
OK |
MS C++ |
TESTS |
62 |
31 |
102400 |
|
2000 |
53462102 |
vjudge2 |
F |
April 28, 2019, 7:52 a.m. |
OK |
MS C++ |
TESTS |
62 |
31 |
204800 |
|
2000 |
53462641 |
vjudge2 |
F |
April 28, 2019, 8:12 a.m. |
OK |
MS C++ |
TESTS |
62 |
31 |
409600 |
|
2000 |
61003432 |
Sanqer WoodMachine beautifulsmile |
F |
Sept. 21, 2019, 10:25 a.m. |
OK |
MS C++ 2017 |
TESTS |
62 |
31 |
0 |
|
2000 |
64731849 |
hi_allerria |
F |
Nov. 12, 2019, 8:44 a.m. |
OK |
MS C++ 2017 |
TESTS |
62 |
31 |
307200 |
|
2000 |
61852365 |
YESMAths |
F |
Oct. 4, 2019, 1:04 p.m. |
OK |
PyPy 2 |
TESTS |
62 |
124 |
102400 |
|
2000 |
54396047 |
gitarist |
F |
May 19, 2019, 8:13 p.m. |
OK |
Python 3 |
TESTS |
62 |
124 |
307200 |
|
2000 |
47377771 |
wol |
F |
Dec. 22, 2018, 6:33 p.m. |
OK |
Python 3 |
TESTS |
62 |
265 |
1126400 |
|
2000 |
46712560 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
46712531 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
46712252 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
46712233 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
46712088 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
46712085 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
46711986 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
46711957 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
46711924 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
46711921 |
|
F |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
2000 |
remove filters
Back to search problems