Codeforces Round 1027 (Div. 3)

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
2114 Codeforces Round 1027 (Div. 3) FINISHED False 8100 28135523 May 26, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 5476 ) F Small Operations PROGRAMMING binary search bitmasks brute force dfs and similar dp math number theory sortings

Given an integer (x) and an integer (k). In one operation, you can perform one of two actions: choose an integer (1 \le a \le k) and assign (x = x \cdot a); choose an integer (1 \le a \le k) and assign (x = \frac{x}{a}), where the value of (\frac{x}{a}) must be an integer. Find the minimum number of operations required to make the number (x) equal to (y), or determine that it is impossible. The first line of the input contains one integer (t) ((1 \le t \le 10^4)) — the number of test cases. The only line of each test case contains three integers (x), (y) and (k) ((1 \le x, y, k \le 10^6)). It is guaranteed that the sum of (x) and the sum of (y) across all test cases does not exceed (10^8). For each test case, output (-1) if it is impossible to achieve (x=y) using the given operations, and the minimum number of required operations otherwise.

Tutorials

143268

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
321619546 TEoS F May 27, 2025, 9:28 a.m. OK C++17 (GCC 7-32) TESTS 64 78 4096000
321676988 quchen F May 27, 2025, 4:17 p.m. OK C++17 (GCC 7-32) TESTS 64 93 0
321630366 Arsh2609 F May 27, 2025, 10:46 a.m. OK C++17 (GCC 7-32) TESTS 64 93 102400
321589272 Axoril F May 27, 2025, 5:30 a.m. OK C++17 (GCC 7-32) TESTS 64 93 102400
321619918 TEoS F May 27, 2025, 9:30 a.m. OK C++17 (GCC 7-32) TESTS 64 93 4096000
321669707 neal27 F May 27, 2025, 3:20 p.m. OK C++17 (GCC 7-32) TESTS 64 109 102400
321681653 birsnot F May 27, 2025, 4:53 p.m. OK C++17 (GCC 7-32) TESTS 64 124 102400
321674806 NoisyBooyyyy F May 27, 2025, 3:59 p.m. OK C++17 (GCC 7-32) TESTS 64 124 4403200
321644507 onid F May 27, 2025, 12:24 p.m. OK C++17 (GCC 7-32) TESTS 64 124 8089600
321724430 FiTr0210 F May 28, 2025, 4:37 a.m. OK C++17 (GCC 7-32) TESTS 65 140 8089600
321719268 Ivan_len F May 28, 2025, 3:18 a.m. OK C++20 (GCC 13-64) TESTS 65 62 102400
321586969 you-jin-plus F May 27, 2025, 5:10 a.m. OK C++20 (GCC 13-64) TESTS 64 92 102400
321707864 Aniket54 F May 27, 2025, 10:26 p.m. OK C++20 (GCC 13-64) TESTS 64 93 102400
321649526 nandhagk1729 F May 27, 2025, 12:57 p.m. OK C++20 (GCC 13-64) TESTS 64 93 102400
321633303 ApraCadabra F May 27, 2025, 11:09 a.m. OK C++20 (GCC 13-64) TESTS 64 93 102400
321587471 you-jin-plus F May 27, 2025, 5:14 a.m. OK C++20 (GCC 13-64) TESTS 64 93 102400
321624641 ABitVeryScaredOfWomen F May 27, 2025, 10:03 a.m. OK C++20 (GCC 13-64) TESTS 64 93 4096000
321584795 jiedesuoyuan F May 27, 2025, 4:47 a.m. OK C++20 (GCC 13-64) TESTS 64 93 16076800
321628398 biaobenplus F May 27, 2025, 10:30 a.m. OK C++20 (GCC 13-64) TESTS 64 93 40140800
321716550 lifang535 F May 28, 2025, 2:34 a.m. OK C++20 (GCC 13-64) TESTS 65 108 102400
321696017 igoroogle F May 27, 2025, 7:06 p.m. OK C++23 (GCC 14-64, msys2) TESTS 64 77 102400
321675568 Kilo_5723 F May 27, 2025, 4:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 64 77 102400
321660948 _Sherbiny F May 27, 2025, 2:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 64 77 102400
321624213 424479543 F May 27, 2025, 10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 77 5017600
321623702 424479543 F May 27, 2025, 9:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 77 5017600
321621902 424479543 F May 27, 2025, 9:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 77 5017600
321678554 halaaa F May 27, 2025, 4:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 64 77 5734400
321624571 FutureHasTomorrow F May 27, 2025, 10:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 64 92 102400
321702057 Suvrat6 F May 27, 2025, 8:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 64 93 102400
321696217 igoroogle F May 27, 2025, 7:08 p.m. OK C++23 (GCC 14-64, msys2) TESTS 64 93 102400
321682725 NenadDapic F May 27, 2025, 5:01 p.m. OK FPC TESTS 64 249 8192000
321668947 AmanRaj-25 F May 27, 2025, 3:15 p.m. OK GNU C11 TESTS 64 2312 9113600
321587040 Balu2907 F May 27, 2025, 5:11 a.m. OK Java 21 TESTS 64 468 9216000
321630839 ironman263 F May 27, 2025, 10:50 a.m. OK Java 21 TESTS 64 531 1843200
321624195 sad_truant F May 27, 2025, 10 a.m. OK Java 21 TESTS 64 577 1228800
321704562 jsonier F May 27, 2025, 9:06 p.m. OK Java 21 TESTS 64 905 1740800
321626679 divya8080 F May 27, 2025, 10:18 a.m. OK Java 21 TESTS 64 1312 9318400
321627297 divya8080 F May 27, 2025, 10:23 a.m. OK Java 21 TESTS 64 1342 8396800
321628875 divya8080 F May 27, 2025, 10:34 a.m. OK Java 21 TESTS 64 1609 9830400
321682040 lyongwolf F May 27, 2025, 4:56 p.m. OK Java 21 TESTS 64 1843 142233600
321705341 Sumitsingh7 F May 27, 2025, 9:23 p.m. OK Java 8 TESTS 64 1187 27443200
321620902 late_night_order F May 27, 2025, 9:38 a.m. OK Java 8 TESTS 64 1655 0
321657001 jagbarrameda F May 27, 2025, 1:48 p.m. OK Kotlin 1.9 TESTS 64 280 2048000
321627795 yuki61256 F May 27, 2025, 10:26 a.m. OK PyPy 3-64 TESTS 64 218 12083200
321645498 Mischievius F May 27, 2025, 12:31 p.m. OK PyPy 3-64 TESTS 64 312 8499200
321668444 ketuOP F May 27, 2025, 3:11 p.m. OK PyPy 3-64 TESTS 64 515 20582400
321709347 akioweh F May 27, 2025, 11:17 p.m. OK PyPy 3-64 TESTS 64 561 10342400
321673219 Arisbek F May 27, 2025, 3:47 p.m. OK PyPy 3-64 TESTS 64 562 54681600
321709533 akioweh F May 27, 2025, 11:22 p.m. OK PyPy 3-64 TESTS 64 592 10444800
321659463 SAM208 F May 27, 2025, 2:05 p.m. OK PyPy 3-64 TESTS 64 655 9932800
321714501 find F May 28, 2025, 1:56 a.m. OK PyPy 3-64 TESTS 65 827 8601600
321616675 Ayushman_123 F May 27, 2025, 9:09 a.m. OK PyPy 3-64 TESTS 64 859 8704000
321634735 minuki646 F May 27, 2025, 11:19 a.m. OK PyPy 3-64 TESTS 64 859 110387200
321619787 Martician F May 27, 2025, 9:29 a.m. OK Rust 2021 TESTS 64 77 102400
321709661 PlaceOrientedProgrammer F May 27, 2025, 11:28 p.m. OK Rust 2021 TESTS 64 218 102400
321632734 MoSooN F May 27, 2025, 11:04 a.m. OK Rust 2021 TESTS 64 328 4915200
321657422 Ming_Xu F May 27, 2025, 1:51 p.m. OK Rust 2021 TESTS 64 1593 215142400

remove filters

Back to search problems