Codeforces Round 599 (Div. 1)

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.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1242 Codeforces Round 599 (Div. 1) FINISHED False 7200 158770499 Nov. 6, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 199 ) D Number Discovery PROGRAMMING math 3400

B"Ujan needs some rest from cleaning, so he started playing with infinite sequences. He has two integers n and k . He creates an infinite sequence s by repeating the following steps. Ujan will stop procrastinating when he writes the number n in the sequence s . Help him find the index of n in s . In other words, find the integer x such that s_{x} = n . It's possible to prove that all positive integers are included in s only once. The first line contains a single integer t ( 1 <= t <= 10^{5} ), the number of test cases. Each of the following t lines contains two integers n and k ( 1 <= n <= 10^{18} , 2 <= k <= 10^{6} ), the number to be found in the sequence s and the parameter used to create the sequence s . In each of the t lines, output the answer for the corresponding test case. In the first sample, s = (1, 2, 3, 4, 5, 9, 6, 7, 13, 8, 10, 18, ldots) . 10 is the 11 -th number here, so the answer is 11 . In the second sample, s = (1, 2, 3, 4, 5, 15, 6, 7, 8, 9, 10, 40, ldots) . "...

Tutorials

Codeforces Round #599 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
64878111 cuizhuyefei D Nov. 14, 2019, 10:38 a.m. OK GNU C++11 TESTS 28 202 0 3400
64451690 WZYYN D Nov. 7, 2019, 7:18 a.m. OK GNU C++11 TESTS 27 202 0 3400
65026376 liyang21 D Nov. 15, 2019, 7:53 a.m. OK GNU C++11 TESTS 28 234 0 3400
64444275 MAOoo D Nov. 7, 2019, 5:53 a.m. OK GNU C++11 TESTS 27 280 0 3400
65334603 jiangly D Nov. 19, 2019, 8:19 a.m. OK GNU C++11 TESTS 28 342 0 3400
67055897 Isonan D Dec. 17, 2019, 6:49 a.m. OK GNU C++11 TESTS 28 358 0 3400
64500929 QAQAutoMaton D Nov. 8, 2019, 4:08 a.m. OK GNU C++11 TESTS 27 358 100556800 3400
64612412 Makaveli D Nov. 10, 2019, 2:36 a.m. OK GNU C++11 TESTS 28 483 0 3400
65556679 birka0 D Nov. 22, 2019, 10:33 p.m. OK GNU C++11 TESTS 28 514 0 3400
65913370 Fuyuki D Nov. 28, 2019, 1:42 p.m. OK GNU C++11 TESTS 28 779 0 3400
64454764 Toxel D Nov. 7, 2019, 8:21 a.m. OK GNU C++14 TESTS 27 171 0 3400
64472064 mayaohua2003 D Nov. 7, 2019, 1:21 p.m. OK GNU C++14 TESTS 27 186 0 3400
64914577 NoTeamName D Nov. 15, 2019, 3:04 a.m. OK GNU C++14 TESTS 28 202 0 3400
64401395 MiFaFaOvO D Nov. 6, 2019, 4:12 p.m. OK GNU C++14 TESTS 26 202 0 3400
64512604 jerome_wei D Nov. 8, 2019, 9:23 a.m. OK GNU C++14 TESTS 27 233 0 3400
64404795 ecnerwala D Nov. 6, 2019, 4:23 p.m. OK GNU C++14 TESTS 26 233 0 3400
64476596 c19m D Nov. 7, 2019, 2:35 p.m. OK GNU C++14 TESTS 27 248 0 3400
65038601 Shayan D Nov. 15, 2019, 12:36 p.m. OK GNU C++14 TESTS 28 280 0 3400
64452799 OYJason D Nov. 7, 2019, 7:42 a.m. OK GNU C++14 TESTS 27 280 0 3400
65498264 DmitryGrigorev D Nov. 21, 2019, 5:34 p.m. OK GNU C++14 TESTS 28 311 0 3400
64426937 Xellos D Nov. 6, 2019, 7:32 p.m. OK GNU C++17 TESTS 26 155 0 3400
64538162 aid D Nov. 8, 2019, 5:40 p.m. OK GNU C++17 TESTS 27 171 0 3400
64426704 majk D Nov. 6, 2019, 7:27 p.m. OK GNU C++17 TESTS 26 171 0 3400
64425448 majk D Nov. 6, 2019, 7:03 p.m. OK GNU C++17 TESTS 26 187 0 3400
64490087 StepMommy D Nov. 7, 2019, 7:31 p.m. OK GNU C++17 TESTS 27 217 0 3400
66181532 erogame D Dec. 2, 2019, 12:59 p.m. OK GNU C++17 TESTS 28 218 0 3400
64431636 paulica D Nov. 6, 2019, 9:40 p.m. OK GNU C++17 TESTS 27 218 0 3400
64420406 Baurr D Nov. 6, 2019, 5:47 p.m. OK GNU C++17 TESTS 26 218 0 3400
64417615 Merkurev D Nov. 6, 2019, 5:03 p.m. OK GNU C++17 TESTS 26 218 0 3400
69605473 gongsuidashen D Jan. 27, 2020, 9:34 a.m. OK GNU C++17 TESTS 28 234 0 3400

remove filters

Back to search problems