Codeforces Round 1059 (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
2162 Codeforces Round 1059 (Div. 3) FINISHED False 8100 15693923 Oct. 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 12250 ) D Beautiful Permutation PROGRAMMING binary search interactive

This is an interactive problem. There is a permutation (^{\text{∗}}) (p) of length (n). Someone secretly chose two integers (l, r) ((1 \le l \le r \le n)) and modified the permutation in the following way: For every index (i) such that (l \le i \le r), set (p_i := p_i + 1). Let (a) denote the resulting array obtained by modifying the permutation. You are given an integer (n) denoting the length of the permutation (p). In one query, you are allowed to choose two integers (l, r) ((1 \le l \le r \le n)) and ask for the sum of the subarray either of the original permutation (pl \dots r) or of the modified array (al \dots r). The answer to such a query will be the corresponding integer sum. Your task is to find the pair ((l, r)) that was chosen to obtain (a) in no more than (\bf{40}) queries. (^{\text{∗}})A permutation of length (n) is an array consisting of (n) distinct integers from (1) to (n) in any order. For example, (2,3,1,5,4) is a permutation, but (1,2,2) is not a permutation (the number (2) appears twice in the array), and (1,3,4) is also not a permutation ((n=3), but the array contains (4)). The first line of input contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. Each test case contains a single integer (n) ((1 \le n \le 2\cdot10^4)) — the length of the permutation. It is guaranteed that the sum of (n) over all the test cases does not exceed (2\cdot10^4). The interaction for each test case begins by reading the integer (n). You can ask two types of queries. Print "(1 l r)" ((1 \le l \le r \le n)). In response, you should read a line containing a single integer (x) — the sum of the subarray of the original permutation. (Formally, (x = p_l + p_{l + 1} + \dots + p_r)). In response, you should read a line containing a single integer (x) — the s

Tutorials

Codeforces Round 1059 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
344510380 og.kostya D Oct. 18, 2025, 2:04 p.m. OK C# 10 TESTS 7 327 2969600
344519556 Equinox_Ya D Oct. 18, 2025, 2:55 p.m. OK C# 13 TESTS 7 312 512000
344493740 og.kostya D Oct. 18, 2025, 12:28 p.m. OK C# 13 TESTS 7 374 2355200
344496251 ksandr1v D Oct. 18, 2025, 12:43 p.m. OK C# 13 TESTS 7 406 307200
344420384 chrisTris D Oct. 18, 2025, 2:23 a.m. OK C# 13 TESTS 7 484 5324800
344509030 PastPrime D Oct. 18, 2025, 1:57 p.m. OK C++17 (GCC 7-32) TESTS 7 124 0
344574145 thercstk D Oct. 19, 2025, 1:10 a.m. OK C++17 (GCC 7-32) TESTS 7 187 0
344510384 ygyashgoyal D Oct. 18, 2025, 2:04 p.m. OK C++17 (GCC 7-32) TESTS 7 202 0
344420931 huguanfu D Oct. 18, 2025, 2:32 a.m. OK C++17 (GCC 7-32) TESTS 7 202 0
344422408 linshao D Oct. 18, 2025, 2:57 a.m. OK C++17 (GCC 7-32) TESTS 7 202 102400
344570318 Divy_8745 D Oct. 18, 2025, 10:46 p.m. OK C++17 (GCC 7-32) TESTS 7 203 0
344420409 qinye_leaf D Oct. 18, 2025, 2:24 a.m. OK C++17 (GCC 7-32) TESTS 7 203 0
344587006 d_sagar D Oct. 19, 2025, 5:22 a.m. OK C++17 (GCC 7-32) TESTS 7 218 0
344544441 ITBlockZ D Oct. 18, 2025, 5:36 p.m. OK C++17 (GCC 7-32) TESTS 7 218 0
344540353 salajbansal D Oct. 18, 2025, 5:06 p.m. OK C++17 (GCC 7-32) TESTS 7 218 0
344584831 arimakanaa D Oct. 19, 2025, 4:52 a.m. OK C++20 (GCC 13-64) TESTS 7 156 0
344496564 abhi____123 D Oct. 18, 2025, 12:45 p.m. OK C++20 (GCC 13-64) TESTS 7 156 0
344509052 yaman.alrifai D Oct. 18, 2025, 1:57 p.m. OK C++20 (GCC 13-64) TESTS 7 186 0
344574915 yuanmouren D Oct. 19, 2025, 1:35 a.m. OK C++20 (GCC 13-64) TESTS 7 187 0
344435055 Abhishek_1355 D Oct. 18, 2025, 5:25 a.m. OK C++20 (GCC 13-64) TESTS 7 187 0
344419982 GaMgium D Oct. 18, 2025, 2:17 a.m. OK C++20 (GCC 13-64) TESTS 7 187 0
344418590 Anas_Ali. D Oct. 18, 2025, 1:52 a.m. OK C++20 (GCC 13-64) TESTS 7 187 0
344582102 wjzsunshine D Oct. 19, 2025, 4:06 a.m. OK C++20 (GCC 13-64) TESTS 7 202 0
344557589 SHK D Oct. 18, 2025, 7:25 p.m. OK C++20 (GCC 13-64) TESTS 7 202 0
344553442 mani_tyuG D Oct. 18, 2025, 6:44 p.m. OK C++20 (GCC 13-64) TESTS 7 202 0
344546506 Ctrcctrv D Oct. 18, 2025, 5:49 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 124 0
344588032 2290_12 D Oct. 19, 2025, 5:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 171 0
344510346 Ishaan_bansal D Oct. 18, 2025, 2:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 171 0
344503129 adityaxsundar D Oct. 18, 2025, 1:24 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 171 0
344421573 liuyi61 D Oct. 18, 2025, 2:43 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 171 3174400
344567433 Kutubkhan_B D Oct. 18, 2025, 9:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 186 0
344540235 King_Jack D Oct. 18, 2025, 5:05 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 186 0
344540899 silvermete0r D Oct. 18, 2025, 5:10 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 0
344510987 Cull D Oct. 18, 2025, 2:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 0
344430184 ArjunMahadik D Oct. 18, 2025, 4:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 7 187 0
344560696 KL2400031478 D Oct. 18, 2025, 8 p.m. OK GNU C11 TESTS 7 312 8396800
344529359 m1_k3 D Oct. 18, 2025, 3:56 p.m. OK Go TESTS 7 296 1740800
344526505 nobody05 D Oct. 18, 2025, 3:37 p.m. OK Go TESTS 7 343 1536000
344517448 m1_k3 D Oct. 18, 2025, 2:43 p.m. OK Go TESTS 7 359 2252800
344579940 oishiki22 D Oct. 19, 2025, 3:27 a.m. OK Java 21 TESTS 7 859 1024000
344543150 Aaditysa01sehgal D Oct. 18, 2025, 5:27 p.m. OK Java 21 TESTS 7 952 1126400
344560163 pcmeena511 D Oct. 18, 2025, 7:53 p.m. OK Java 21 TESTS 7 1015 1536000
344554887 owner_of_world D Oct. 18, 2025, 6:58 p.m. OK Java 21 TESTS 7 1062 1843200
344512127 sahil_2448_coder D Oct. 18, 2025, 2:13 p.m. OK Java 21 TESTS 7 1062 1843200
344494195 icpc_loser D Oct. 18, 2025, 12:31 p.m. OK Java 21 TESTS 7 1093 1843200
344505954 niksybiksy D Oct. 18, 2025, 1:40 p.m. OK Java 21 TESTS 7 1124 716800
344520018 vellacoder1 D Oct. 18, 2025, 2:58 p.m. OK Java 21 TESTS 7 1124 1536000
344422741 _mi_ka_java D Oct. 18, 2025, 3:01 a.m. OK Java 21 TESTS 7 1140 1024000
344559231 LordKRiS D Oct. 18, 2025, 7:43 p.m. OK Java 21 TESTS 7 1155 921600
344427630 deepthisuddapalli05 D Oct. 18, 2025, 4:09 a.m. OK Java 8 TESTS 7 1343 0
344433150 prime29 D Oct. 18, 2025, 5:09 a.m. OK Java 8 TESTS 7 1358 0
344422602 KLU2300033802 D Oct. 18, 2025, 2:59 a.m. OK Java 8 TESTS 7 1389 0
344555085 harshmehar50 D Oct. 18, 2025, 7 p.m. OK Java 8 TESTS 7 1484 0
344434011 rushi1105 D Oct. 18, 2025, 5:17 a.m. OK Java 8 TESTS 7 1702 0
344531924 kirilldyachkovskiy D Oct. 18, 2025, 4:12 p.m. OK Node.js TESTS 7 1467 4096000
344517716 quandum D Oct. 18, 2025, 2:44 p.m. OK PyPy 3 TESTS 7 968 9625600
344509345 Luciefer_x D Oct. 18, 2025, 1:58 p.m. OK PyPy 3-64 TESTS 7 686 7372800
344433854 bh1rg1v D Oct. 18, 2025, 5:15 a.m. OK PyPy 3-64 TESTS 7 718 8499200
344424219 Aayush_69 D Oct. 18, 2025, 3:23 a.m. OK PyPy 3-64 TESTS 7 749 7884800
344585692 ZaeThrix D Oct. 19, 2025, 5:05 a.m. OK PyPy 3-64 TESTS 7 749 9113600
344556460 oizg D Oct. 18, 2025, 7:13 p.m. OK PyPy 3-64 TESTS 7 765 7680000
344436965 DivyamAwasthy D Oct. 18, 2025, 5:43 a.m. OK PyPy 3-64 TESTS 7 780 6246400
344518607 Machine1569 D Oct. 18, 2025, 2:50 p.m. OK PyPy 3-64 TESTS 7 827 7577600
344525896 codsila D Oct. 18, 2025, 3:33 p.m. OK PyPy 3-64 TESTS 7 828 6451200
344528373 Luciefer_x D Oct. 18, 2025, 3:50 p.m. OK PyPy 3-64 TESTS 7 828 7782400
344585448 ZaeThrix D Oct. 19, 2025, 5:01 a.m. OK PyPy 3-64 TESTS 7 858 9113600
344550561 haochenglin454 D Oct. 18, 2025, 6:20 p.m. OK Python 3 TESTS 7 499 204800
344420775 lucnguyen030608 D Oct. 18, 2025, 2:30 a.m. OK Python 3 TESTS 7 499 204800
344524628 garuda_07 D Oct. 18, 2025, 3:26 p.m. OK Python 3 TESTS 7 656 102400
344526413 kusumakilari2 D Oct. 18, 2025, 3:37 p.m. OK Python 3 TESTS 7 686 204800
344530929 TSillB D Oct. 18, 2025, 4:06 p.m. OK Python 3 TESTS 7 750 204800
344545558 Jigisha_ D Oct. 18, 2025, 5:43 p.m. OK Python 3 TESTS 7 764 204800
344514648 Hemadevika_64 D Oct. 18, 2025, 2:27 p.m. OK Python 3 TESTS 7 796 204800
344419301 KinaRight D Oct. 18, 2025, 2:04 a.m. OK Python 3 TESTS 7 811 204800
344496552 ehsansoltanm D Oct. 18, 2025, 12:45 p.m. OK Python 3 TESTS 7 827 204800
344563102 isa773 D Oct. 18, 2025, 8:28 p.m. OK Python 3 TESTS 7 890 204800
344419694 silicalet D Oct. 18, 2025, 2:11 a.m. OK Rust 2024 TESTS 7 280 0

remove filters

Back to search problems