Codeforces Round 1068 (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
2173 Codeforces Round 1068 (Div. 2) FINISHED False 7200 11460323 Dec. 5, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1506 ) E Shiro's Mirror Duel PROGRAMMING interactive probabilities

This is an interactive problem. One day, Sora and Shiro feel bored again, so they decide to settle it with a game. At the beginning, Sora gives Shiro a permutation(^{\text{∗}}) (p_1,p_2,\ldots,p_n) of length (n). In each operation, Shiro may select two distinct indices (x) and (y) ((1\le x\ne y\le n)). Then Sora flips a fair coin: With probability (0.5), Sora swaps (p_x) and (p_y); With probability (0.5), Sora swaps (p_{n-x+1}) and (p_{n-y+1}). After the operation, Sora replies with the actual pair of indices that were swapped, so that Shiro can update her local permutation accordingly. Shiro's goal is to sort the permutation (p) in ascending order by using at most (\lfloor 2.5n+800\rfloor) operations. Help her! (^{\text{∗}})A permutation of length (n) is an array consisting of (n) distinct integers from (1) to (n) in arbitrary order. For example, (2,3,1,5,4) is a permutation, but (1,2,2) is not a permutation ((2) appears twice in the array), and (1,3,4) is also not a permutation ((n=3) but there is (4) in the array). Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1\le n\le 4000)) — the length of (p). The second line contains (n) integers (p_1,p_2,\ldots,p_n) — the elements of (p). It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot 10^4). It is guaranteed that there are (50) tests in this problem. For each test case, you can use at most (\lfloor 2.5n+800\rfloor) moves to sort the permutation (p) in ascending order. To make a move, you should print a new line in the following format: (\mathtt{?}\; x\; y) ((1 \le x \ne y \le n)) — the two indices that Shiro selects in this move. As a response t

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
352123719 walizamanee E Dec. 5, 2025, 7:45 p.m. OK C++17 (GCC 7-32) TESTS 50 171 102400
352095112 red0116 E Dec. 5, 2025, 4:26 p.m. OK C++17 (GCC 7-32) TESTS 50 171 102400
352169254 hansery E Dec. 6, 2025, 6:09 a.m. OK C++17 (GCC 7-32) TESTS 50 187 102400
352103740 tfgs E Dec. 5, 2025, 5:20 p.m. OK C++17 (GCC 7-32) TESTS 50 187 102400
352097760 kuzmichev_dima E Dec. 5, 2025, 4:31 p.m. OK C++17 (GCC 7-32) TESTS 50 187 102400
352092852 legoflowers E Dec. 5, 2025, 4:21 p.m. OK C++17 (GCC 7-32) TESTS 50 187 1638400
352103075 meiganghao E Dec. 5, 2025, 5:17 p.m. OK C++17 (GCC 7-32) TESTS 50 187 3276800
352111282 silentail E Dec. 5, 2025, 6:04 p.m. OK C++17 (GCC 7-32) TESTS 50 203 0
352103644 CausalBit E Dec. 5, 2025, 5:19 p.m. OK C++17 (GCC 7-32) TESTS 50 203 0
352166113 Goldenglow E Dec. 6, 2025, 5:44 a.m. OK C++17 (GCC 7-32) TESTS 50 203 102400
352150663 _Air2011_ E Dec. 6, 2025, 3 a.m. OK C++20 (GCC 13-64) TESTS 50 125 102400
352154775 Danielcdo E Dec. 6, 2025, 3:51 a.m. OK C++20 (GCC 13-64) TESTS 50 140 0
352152518 Sheelocean E Dec. 6, 2025, 3:23 a.m. OK C++20 (GCC 13-64) TESTS 50 140 0
352154685 Danielcdo E Dec. 6, 2025, 3:50 a.m. OK C++20 (GCC 13-64) TESTS 50 140 102400
352152286 zztqwq E Dec. 6, 2025, 3:20 a.m. OK C++20 (GCC 13-64) TESTS 50 140 102400
352148704 toba E Dec. 6, 2025, 2:37 a.m. OK C++20 (GCC 13-64) TESTS 50 140 102400
352129850 Payea E Dec. 5, 2025, 8:54 p.m. OK C++20 (GCC 13-64) TESTS 50 140 102400
352112233 Kan_kiz E Dec. 5, 2025, 6:10 p.m. OK C++20 (GCC 13-64) TESTS 50 140 102400
352103303 Teto E Dec. 5, 2025, 5:18 p.m. OK C++20 (GCC 13-64) TESTS 50 140 102400
352098344 HOO_KKn E Dec. 5, 2025, 4:32 p.m. OK C++20 (GCC 13-64) TESTS 50 140 102400
352103278 Ayalla E Dec. 5, 2025, 5:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 125 0
352095939 vlp E Dec. 5, 2025, 4:28 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 140 0
352093102 benben181 E Dec. 5, 2025, 4:22 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 140 0
352141835 konghaojie E Dec. 6, 2025, 1:01 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 140 102400
352108906 tin.le2 E Dec. 5, 2025, 5:49 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 140 102400
352149041 123m456jx E Dec. 6, 2025, 2:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 156 0
352091851 Moretti_Zaria E Dec. 5, 2025, 4:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 156 0
352091244 av_25 E Dec. 5, 2025, 4:18 p.m. OK C++23 (GCC 14-64, msys2) TESTS 50 156 0
352165661 Uraykevoli E Dec. 6, 2025, 5:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 156 102400
352161145 bary E Dec. 6, 2025, 4:59 a.m. OK C++23 (GCC 14-64, msys2) TESTS 50 156 102400
352092385 Gassa E Dec. 5, 2025, 4:20 p.m. OK D TESTS 50 359 3174400
352093772 javidbid E Dec. 5, 2025, 4:23 p.m. OK FPC TESTS 50 203 0
352117536 jschr E Dec. 5, 2025, 6:52 p.m. OK GNU C11 TESTS 50 406 8396800
352114931 h_maano E Dec. 5, 2025, 6:30 p.m. OK Java 21 TESTS 50 703 1945600
352128866 NiceOfYou E Dec. 5, 2025, 8:41 p.m. OK Java 21 TESTS 50 921 2662400
352151901 Mukundan314 E Dec. 6, 2025, 3:15 a.m. OK PyPy 3-64 TESTS 50 531 10444800
352104065 Mukundan314 E Dec. 5, 2025, 5:21 p.m. OK PyPy 3-64 TESTS 50 593 12697600
352099343 Ayis137 E Dec. 5, 2025, 4:34 p.m. OK PyPy 3-64 TESTS 50 609 8396800
352104319 fatalerror E Dec. 5, 2025, 5:23 p.m. OK PyPy 3-64 TESTS 50 671 9216000
352117942 Emikooh E Dec. 5, 2025, 6:55 p.m. OK PyPy 3-64 TESTS 50 703 9523200
352093749 x3x3 E Dec. 5, 2025, 4:23 p.m. OK PyPy 3-64 TESTS 50 703 12492800
352105656 dong0625 E Dec. 5, 2025, 5:30 p.m. OK PyPy 3-64 TESTS 50 718 9011200
352097370 tranlehieu E Dec. 5, 2025, 4:30 p.m. OK PyPy 3-64 TESTS 50 765 8908800
352096152 stan23456 E Dec. 5, 2025, 4:28 p.m. OK PyPy 3-64 TESTS 50 765 9420800
352095693 SumitKundu E Dec. 5, 2025, 4:27 p.m. OK PyPy 3-64 TESTS 50 765 9625600
352156003 ACr0bat E Dec. 6, 2025, 4:07 a.m. OK Python 3 TESTS 50 609 512000
352096719 Nurmyrat E Dec. 5, 2025, 4:29 p.m. OK Python 3 TESTS 50 625 1638400
352103106 ecubic E Dec. 5, 2025, 5:17 p.m. OK Python 3 TESTS 50 734 1945600
352103125 NagisaF E Dec. 5, 2025, 5:17 p.m. OK Rust 2021 TESTS 50 156 102400
352144439 despair E Dec. 6, 2025, 1:45 a.m. OK Rust 2024 TESTS 50 93 0
352094977 RustyMonoid E Dec. 5, 2025, 4:26 p.m. OK Rust 2024 TESTS 50 156 0

remove filters

Back to search problems