Codeforces Round 1025 (Div. 2)

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
2109 Codeforces Round 1025 (Div. 2) FINISHED False 8100 28913123 May 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 8586 ) C2 Hacking Numbers (Medium Version) PROGRAMMING constructive algorithms interactive math number theory

This is the medium version of the problem. In this version, you can send at most (\mathbf{4}) commands. You can make hacks only if all versions of the problem are solved. This is an interactive problem. Welcome, Duelists! In this interactive challenge, there is an unknown integer (x) ((1 \le x \le 10^9)). You must make it equal to a given integer in the input (n). By harnessing the power of "Mathmech" monsters, you can send a command to do one of the following: You have to make (x) equal to (n) using at most (\mathbf{4}) commands. (^{\text{∗}})(S(n)) is a function that returns the sum of all the individual digits of a non-negative integer (n). For example, (S(123) = 1 + 2 + 3 = 6) Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 5000)). The description of the test cases follows. The first and only line of each test case contains one integer (n) ((1 \le n \le 10^9)). The interaction for each test case begins by reading the integer (n). To send a command, output a line in the following format: "add (y)" Add some integer (y) ((-10^{18} \le y \le 10^{18})) to (x). The jury will output "1" if (x + y) is within (1, 10^{18}) ( successful ), and "0" otherwise. If successful, update (x \leftarrow x + y). The jury will output "1" if (x + y) is within (1, 10^{18}) ( successful ), and "0" otherwise. If successful, update (x \leftarrow x + y). "mul (y)" Multiply (x) by a positive integer (y) ((1 \le y \le 10^{18})). The jury will output "1" if (x \cdot y) is within (1, 10^{18}) ( successful ), and "0" otherwise. If successful, update (x \leftarrow x \cdot y). The jury will output "1" if (x \cdot y) is within (1, 10^{18}) ( successful ), and "0" otherwise. If successful, update (x \leftarrow x \cdot y). "div (y)" Divide (x) by a positive integer (y) ($

Tutorials

Codeforces Round 1025 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
320130504 og.kostya C2 May 17, 2025, 4:44 p.m. OK C# 10 TESTS 20 265 1126400
320167087 lizhuoheng C2 May 18, 2025, 2:03 a.m. OK C++17 (GCC 7-32) TESTS 20 171 0
320170654 Ke9_qux C2 May 18, 2025, 3:02 a.m. OK C++17 (GCC 7-32) TESTS 20 171 102400
320173929 hahahaaa C2 May 18, 2025, 3:51 a.m. OK C++17 (GCC 7-32) TESTS 20 202 102400
320166002 jestinroy3 C2 May 18, 2025, 1:40 a.m. OK C++17 (GCC 7-32) TESTS 20 202 102400
320165852 LS-Z66066 C2 May 18, 2025, 1:37 a.m. OK C++17 (GCC 7-32) TESTS 20 202 102400
320140013 nem C2 May 17, 2025, 6:13 p.m. OK C++17 (GCC 7-32) TESTS 20 202 102400
320160098 spaghetti_coder C2 May 17, 2025, 10:38 p.m. OK C++17 (GCC 7-32) TESTS 20 202 1228800
320181036 vishwatej_shende C2 May 18, 2025, 4:48 a.m. OK C++17 (GCC 7-32) TESTS 20 203 0
320174579 Manish.kumarrrrr C2 May 18, 2025, 4:01 a.m. OK C++17 (GCC 7-32) TESTS 20 203 102400
320169991 lucky__389 C2 May 18, 2025, 2:52 a.m. OK C++17 (GCC 7-32) TESTS 20 203 102400
320170345 fishcathu C2 May 18, 2025, 2:57 a.m. OK C++20 (GCC 13-64) TESTS 20 155 102400
320181606 secretman1312 C2 May 18, 2025, 4:55 a.m. OK C++20 (GCC 13-64) TESTS 20 171 102400
320141369 dzik77 C2 May 17, 2025, 6:20 p.m. OK C++20 (GCC 13-64) TESTS 20 186 102400
320184838 raghavgupta256 C2 May 18, 2025, 5:32 a.m. OK C++20 (GCC 13-64) TESTS 20 187 102400
320173516 CastWell-1 C2 May 18, 2025, 3:45 a.m. OK C++20 (GCC 13-64) TESTS 20 187 102400
320167189 FlowerandYou C2 May 18, 2025, 2:05 a.m. OK C++20 (GCC 13-64) TESTS 20 187 102400
320144396 Basargin C2 May 17, 2025, 6:40 p.m. OK C++20 (GCC 13-64) TESTS 20 187 102400
320140322 R6mez C2 May 17, 2025, 6:14 p.m. OK C++20 (GCC 13-64) TESTS 20 187 102400
320132704 abcd_14_ C2 May 17, 2025, 4:47 p.m. OK C++20 (GCC 13-64) TESTS 20 187 102400
320129295 sunchaoyi C2 May 17, 2025, 4:41 p.m. OK C++20 (GCC 13-64) TESTS 20 187 102400
320162829 exccc C2 May 18, 2025, 12:08 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 171 102400
320149656 TheYashB C2 May 17, 2025, 7:33 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 171 102400
320144389 joaohenalves C2 May 17, 2025, 6:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 171 4096000
320141141 dfkln-TuT C2 May 17, 2025, 6:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 171 6451200
320171801 Ropraite C2 May 18, 2025, 3:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 186 0
320174611 lrx___ C2 May 18, 2025, 4:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 186 102400
320179804 gesong1234 C2 May 18, 2025, 4:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 187 0
320164788 yyy..wait C2 May 18, 2025, 1:12 a.m. OK C++23 (GCC 14-64, msys2) TESTS 20 187 102400
320146299 I_love_humingyu C2 May 17, 2025, 6:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 187 102400
320144720 karock C2 May 17, 2025, 6:43 p.m. OK C++23 (GCC 14-64, msys2) TESTS 20 187 102400
320152936 Kunwar_Bhathal C2 May 17, 2025, 8:15 p.m. OK Java 21 TESTS 20 562 1024000
320182306 jogojo C2 May 18, 2025, 5:04 a.m. OK Java 21 TESTS 20 593 1228800
320152770 mandeepkakkar C2 May 17, 2025, 8:13 p.m. OK Java 21 TESTS 20 640 921600
320140290 priyaroy3370 C2 May 17, 2025, 6:14 p.m. OK Java 21 TESTS 20 718 2048000
320188285 barbarian C2 May 18, 2025, 6:04 a.m. OK Java 21 TESTS 20 842 1331200
320159898 wddd C2 May 17, 2025, 10:32 p.m. OK Java 21 TESTS 20 843 1126400
320144395 Burhan_Akkus C2 May 17, 2025, 6:40 p.m. OK Java 21 TESTS 20 843 1638400
320129191 Diptarshi C2 May 17, 2025, 4:41 p.m. OK Java 21 TESTS 20 875 1433600
320129658 yuji9000 C2 May 17, 2025, 4:42 p.m. OK Java 21 TESTS 20 905 1024000
320186853 Nobita-Niyan C2 May 18, 2025, 5:51 a.m. OK Java 21 TESTS 20 905 1536000
320180902 Ovetsar_ilish C2 May 18, 2025, 4:46 a.m. OK Java 8 TESTS 20 733 0
320155235 devjain_1028 C2 May 17, 2025, 8:49 p.m. OK PyPy 3 TESTS 20 687 4812800
320155542 devjain_1028 C2 May 17, 2025, 8:54 p.m. OK PyPy 3 TESTS 20 749 5427200
320128930 ChaoticOrder C2 May 17, 2025, 4:41 p.m. OK PyPy 3 TESTS 20 765 3686400
320129428 _gaurav_3043 C2 May 17, 2025, 4:42 p.m. OK PyPy 3 TESTS 20 827 4812800
320146778 hocln C2 May 17, 2025, 7:02 p.m. OK PyPy 3 TESTS 20 890 4710400
320141086 Kabish07 C2 May 17, 2025, 6:18 p.m. OK PyPy 3 TESTS 20 983 7987200
320146366 extr3m3 C2 May 17, 2025, 6:58 p.m. OK PyPy 3 TESTS 20 1046 7987200
320146564 hocln C2 May 17, 2025, 7 p.m. OK PyPy 3 TESTS 20 1093 6656000
320172284 vss103824_Umar.Farooq C2 May 18, 2025, 3:27 a.m. OK PyPy 3-64 TESTS 20 375 5120000
320142195 minuki646 C2 May 17, 2025, 6:25 p.m. OK PyPy 3-64 TESTS 20 389 4403200
320173213 vss103824_Umar.Farooq C2 May 18, 2025, 3:41 a.m. OK PyPy 3-64 TESTS 20 390 5120000
320157468 kavorka C2 May 17, 2025, 9:30 p.m. OK PyPy 3-64 TESTS 20 406 4198400
320141105 miqro C2 May 17, 2025, 6:18 p.m. OK PyPy 3-64 TESTS 20 546 3686400
320181400 quad_wipe C2 May 18, 2025, 4:53 a.m. OK PyPy 3-64 TESTS 20 546 5939200
320129993 qwerty1236 C2 May 17, 2025, 4:43 p.m. OK PyPy 3-64 TESTS 20 562 4710400
320143358 tempaccount12341234 C2 May 17, 2025, 6:32 p.m. OK PyPy 3-64 TESTS 20 578 4096000
320140914 miya145592 C2 May 17, 2025, 6:17 p.m. OK PyPy 3-64 TESTS 20 593 3891200
320163633 ibraheemkureshi C2 May 18, 2025, 12:37 a.m. OK PyPy 3-64 TESTS 20 593 4403200
320179091 biltharesatyendra C2 May 18, 2025, 4:20 a.m. OK Python 2 TESTS 20 281 0
320149688 amod_24 C2 May 17, 2025, 7:34 p.m. OK Python 3 TESTS 20 483 409600
320131512 anmol.04 C2 May 17, 2025, 4:45 p.m. OK Python 3 TESTS 20 499 409600
320168109 pundruvarshith17 C2 May 18, 2025, 2:23 a.m. OK Python 3 TESTS 20 530 409600
320130452 kitkat.lover C2 May 17, 2025, 4:44 p.m. OK Python 3 TESTS 20 546 409600
320132292 Avnesh C2 May 17, 2025, 4:47 p.m. OK Python 3 TESTS 20 562 409600
320165391 silicalet C2 May 18, 2025, 1:26 a.m. OK Rust 2021 TESTS 20 312 102400
320149773 0x81 C2 May 17, 2025, 7:35 p.m. OK Rust 2021 TESTS 20 358 0
320128804 fujishu C2 May 17, 2025, 4:41 p.m. OK Rust 2021 TESTS 20 359 102400

remove filters

Back to search problems