CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!)

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
1870 CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 8100 42132263 Sept. 18, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 503 ) F Lazy Numbers PROGRAMMING binary search math

B'You are given positive integers n and k . For each number from 1 to n , we write its representation in the number system with base k (without leading zeros) and then sort the resulting array in lexicographic order as strings. In the sorted array, we number the elements from 1 to n (i.e., indexing starts from 1 ). Find the number of values i such that the representation of number i is at the i -th position in the sorted array of representations. Examples of representations: 1 in any number system is equal to 1 , 7 with k = 3 is written as 21 , and 81 with k = 9 is written as 100 . The first line contains a single integer t ( 1 <= q t <= q 10^3 ) -- the number of test cases. This is followed by a description of the test cases. The only line of each test case contains integers n and k ( 1 <= q n <= q 10^{18} , 2 <= q k <= q 10^{18} ). For each test case, output a single integer -- the number of values 1 <= q i <= q n such that the representation of number i in the number system with base k is at the i -th position after sorting. In the first test case, for numbers 1 and 2 , their representations are at positions 1 and 2 respectively. In the second test case, the sorted array is [1_2 = 1, 10_2 = 2, 100_2 = 4, 11_2 = 3] , and only the representations of numbers 1 and 2 are at the required positions. In the third test case, the sorted array is [1_4 = 1, 10_4 = 4, 11_4 = 5, 12_4 = 6, 2_4 = 2, 3_4 = 3] , and only the number 1 is at its position. '...

Tutorials

CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
223935129 rainboy F Sept. 18, 2023, 7:08 p.m. OK GNU C11 TESTS 32 2496 0
223916184 20333333333 F Sept. 18, 2023, 4:44 p.m. OK GNU C++14 TESTS 32 1419 2150400
223971745 fjashufi F Sept. 19, 2023, 3:18 a.m. OK GNU C++14 TESTS 32 1950 0
223971586 fjashufi F Sept. 19, 2023, 3:15 a.m. OK GNU C++14 TESTS 32 1996 0
223964531 -LAP- F Sept. 19, 2023, 1:26 a.m. OK GNU C++14 TESTS 32 2433 204800
223953114 Dominater069 F Sept. 18, 2023, 8:51 p.m. OK GNU C++17 TESTS 32 997 204800
223926562 int65536 F Sept. 18, 2023, 5:56 p.m. OK GNU C++17 TESTS 32 1638 1638400
223911396 potato167 F Sept. 18, 2023, 4:32 p.m. OK GNU C++17 TESTS 32 1731 0
223979795 Mag1sk F Sept. 19, 2023, 5:27 a.m. OK GNU C++17 TESTS 32 2089 204800
223930145 pooty F Sept. 18, 2023, 6:22 p.m. OK GNU C++17 TESTS 32 2308 512000
223915725 353cerega F Sept. 18, 2023, 4:43 p.m. OK GNU C++17 (64) TESTS 32 78 0
223922942 Morphymorphymorphy F Sept. 18, 2023, 5:34 p.m. OK GNU C++17 (64) TESTS 32 265 0
223960207 liuhengxi F Sept. 18, 2023, 11:39 p.m. OK GNU C++17 (64) TESTS 32 998 0
223957980 amiya F Sept. 18, 2023, 10:31 p.m. OK GNU C++17 (64) TESTS 32 1357 307200
223974009 Crystally F Sept. 19, 2023, 3:56 a.m. OK GNU C++17 (64) TESTS 32 1372 12800000
223922997 SpaceJellyfish F Sept. 18, 2023, 5:34 p.m. OK GNU C++17 (64) TESTS 32 1622 204800
223934013 Sana F Sept. 18, 2023, 6:57 p.m. OK GNU C++17 (64) TESTS 32 1872 0
223911762 YocyCraft F Sept. 18, 2023, 4:33 p.m. OK GNU C++17 (64) TESTS 32 1918 0
223932528 Sana F Sept. 18, 2023, 6:42 p.m. OK GNU C++17 (64) TESTS 32 2028 0
223918042 kotatsugame F Sept. 18, 2023, 4:48 p.m. OK GNU C++17 (64) TESTS 32 2308 0
223913800 namelessgugugu F Sept. 18, 2023, 4:38 p.m. OK GNU C++20 (64) TESTS 32 140 8294400
223913718 Brewess F Sept. 18, 2023, 4:38 p.m. OK GNU C++20 (64) TESTS 32 171 0
223931804 LeoPro F Sept. 18, 2023, 6:35 p.m. OK GNU C++20 (64) TESTS 32 499 204800
223954329 ok777777788 F Sept. 18, 2023, 9:13 p.m. OK GNU C++20 (64) TESTS 32 951 0
223917211 Everule F Sept. 18, 2023, 4:46 p.m. OK GNU C++20 (64) TESTS 32 998 0
223926569 orz F Sept. 18, 2023, 5:56 p.m. OK GNU C++20 (64) TESTS 32 1185 819200
223912063 Maksim1744 F Sept. 18, 2023, 4:34 p.m. OK GNU C++20 (64) TESTS 32 1201 0
223911644 244mhq F Sept. 18, 2023, 4:33 p.m. OK GNU C++20 (64) TESTS 32 1232 0
223975463 Hritik12 F Sept. 19, 2023, 4:19 a.m. OK GNU C++20 (64) TESTS 32 1326 12800000
223964351 BalintR F Sept. 19, 2023, 1:22 a.m. OK GNU C++20 (64) TESTS 32 1716 0

remove filters

Back to search problems