CodeTON Round 7 (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
1896 CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 9000 36256163 Nov. 25, 2023, 2:50 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2307 ) E Permutation Sorting PROGRAMMING data structures divide and conquer sortings

B'You are given a permutation ^ dagger a of size n . We call an index i good if a_i=i is satisfied. After each second, we rotate all indices that are not good to the right by one position. Formally, For each i from 1 to n , find the first time that index i becomes good. ^ dagger A permutation 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 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 10^6 ) -- the size of permutation a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ) -- the elements of permutation a . It is guaranteed that the sum of n over all test cases does not exceed 10^6 . For each test case, output a single line containing n integers where the i -th integer represents the first time that index i becomes good. In the first test case, 2 and 5 are already in the correct position so indices 2 and 5 become good at 0 second. After 1 second, a cyclic shift will be done with s=[1, 3, 4] , resulting in array a=[1, 2, 3, 4, 5] . Notice that indices 1 , 3 and 4 become good at 1 second. In the second test case, 5 is already in the correct position, so index 5 becomes good at 0 second. After 1 second, a cyclic shift will be done with s=[1, 2, 3, 4, 6] , resulting in array a=[3, 2, 1, 4, 5, 6] . Notice that indices 2 , 4 and 6$$'...

Tutorials

CodeTON Round 7 (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
234305609 jiangtaizhe001 E Nov. 25, 2023, 5:08 p.m. OK GNU C++14 TESTS 23 452 16076800
234296459 HHH666666 E Nov. 25, 2023, 4:37 p.m. OK GNU C++14 TESTS 23 452 24064000
234304506 masonpop E Nov. 25, 2023, 5:05 p.m. OK GNU C++14 TESTS 23 482 24064000
234291281 giotozila E Nov. 25, 2023, 4:19 p.m. OK GNU C++14 TESTS 23 483 20070400
234318198 dancho E Nov. 25, 2023, 6:28 p.m. OK GNU C++14 TESTS 23 483 33587200
234302551 LuckyRandom E Nov. 25, 2023, 4:58 p.m. OK GNU C++14 TESTS 23 514 49561600
234303282 Coder2020HCY E Nov. 25, 2023, 5 p.m. OK GNU C++14 TESTS 23 514 64102400
234313156 ExRoc__ E Nov. 25, 2023, 5:52 p.m. OK GNU C++14 TESTS 23 530 32051200
234298670 Leo_W E Nov. 25, 2023, 4:44 p.m. OK GNU C++14 TESTS 23 530 40140800
234301377 KeroQ E Nov. 25, 2023, 4:54 p.m. OK GNU C++14 TESTS 23 545 20992000
234299776 zzwtx E Nov. 25, 2023, 4:48 p.m. OK GNU C++17 TESTS 23 436 16076800
234321750 JCooper14 E Nov. 25, 2023, 7:05 p.m. OK GNU C++17 TESTS 23 452 24064000
234353884 xuancx E Nov. 26, 2023, 4:54 a.m. OK GNU C++17 TESTS 23 467 16076800
234298787 donny1234 E Nov. 25, 2023, 4:45 p.m. OK GNU C++17 TESTS 23 467 28057600
234295098 AliiSh E Nov. 25, 2023, 4:32 p.m. OK GNU C++17 TESTS 23 467 32051200
234290927 DeepinC E Nov. 25, 2023, 4:18 p.m. OK GNU C++17 TESTS 23 467 32051200
234354373 xuancx E Nov. 26, 2023, 5:01 a.m. OK GNU C++17 TESTS 23 468 16076800
234299679 Nahidameow E Nov. 25, 2023, 4:48 p.m. OK GNU C++17 TESTS 23 468 18124800
234317106 Turkhuuu E Nov. 25, 2023, 6:18 p.m. OK GNU C++17 TESTS 23 482 24064000
234354024 xuancx E Nov. 26, 2023, 4:56 a.m. OK GNU C++17 TESTS 23 483 16076800
234315478 apoorv_me E Nov. 25, 2023, 6:05 p.m. OK GNU C++17 (64) TESTS 23 342 28057600
234295469 SW2000 E Nov. 25, 2023, 4:34 p.m. OK GNU C++17 (64) TESTS 23 373 20070400
234332986 illyakr E Nov. 25, 2023, 9:33 p.m. OK GNU C++17 (64) TESTS 23 374 48332800
234296804 User_Carrot E Nov. 25, 2023, 4:38 p.m. OK GNU C++17 (64) TESTS 23 389 40038400
234305421 prairie2022 E Nov. 25, 2023, 5:08 p.m. OK GNU C++17 (64) TESTS 23 390 44134400
234330189 rainboy E Nov. 25, 2023, 8:51 p.m. OK GNU C++17 (64) TESTS 23 405 15974400
234354374 pipipipipi43 E Nov. 26, 2023, 5:01 a.m. OK GNU C++17 (64) TESTS 23 405 16076800
234354519 udon1206 E Nov. 26, 2023, 5:04 a.m. OK GNU C++17 (64) TESTS 23 405 24064000
234296612 y_combinator E Nov. 25, 2023, 4:37 p.m. OK GNU C++17 (64) TESTS 23 405 24064000
234295726 t98slider E Nov. 25, 2023, 4:34 p.m. OK GNU C++17 (64) TESTS 23 405 28160000
234358106 thisislike E Nov. 26, 2023, 5:56 a.m. OK GNU C++20 (64) TESTS 23 249 16076800
234328501 thatprogrammer E Nov. 25, 2023, 8:27 p.m. OK GNU C++20 (64) TESTS 23 265 24064000
234324637 leanchec E Nov. 25, 2023, 7:39 p.m. OK GNU C++20 (64) TESTS 23 265 24166400
234339237 Sparkle_Twilight E Nov. 25, 2023, 11:44 p.m. OK GNU C++20 (64) TESTS 23 280 16076800
234313671 menezesd2 E Nov. 25, 2023, 5:54 p.m. OK GNU C++20 (64) TESTS 23 280 16076800
234298642 atodo E Nov. 25, 2023, 4:44 p.m. OK GNU C++20 (64) TESTS 23 280 16076800
234337410 Andrija E Nov. 25, 2023, 10:59 p.m. OK GNU C++20 (64) TESTS 23 280 20070400
234335447 czhang2718 E Nov. 25, 2023, 10:17 p.m. OK GNU C++20 (64) TESTS 23 280 20070400
234297207 darkkcyan E Nov. 25, 2023, 4:39 p.m. OK GNU C++20 (64) TESTS 23 280 20070400
234357998 thisislike E Nov. 26, 2023, 5:55 a.m. OK GNU C++20 (64) TESTS 23 280 24064000
234308949 profchi E Nov. 25, 2023, 5:19 p.m. OK Java 11 TESTS 23 1247 114995200
234296827 earl_of_byteland E Nov. 25, 2023, 4:38 p.m. OK Java 17 TESTS 23 2417 177766400
234330492 TCchen E Nov. 25, 2023, 8:56 p.m. OK Java 17 TESTS 23 3088 173260800
234328696 TCchen E Nov. 25, 2023, 8:30 p.m. OK Java 17 TESTS 23 3494 230092800
234353353 mapleKing E Nov. 26, 2023, 4:44 a.m. OK Java 17 TESTS 23 3914 96256000
234329710 amaturecoder E Nov. 25, 2023, 8:44 p.m. OK Java 8 TESTS 23 436 37376000
234329543 rowechen E Nov. 25, 2023, 8:42 p.m. OK Java 8 TESTS 23 732 170700800
234325488 arvindf232 E Nov. 25, 2023, 7:48 p.m. OK Kotlin 1.6 TESTS 23 748 21094400
234318258 Piashy E Nov. 25, 2023, 6:29 p.m. OK MS C++ 2017 TESTS 23 3774 148480000
234332531 SoleProprietor E Nov. 25, 2023, 9:26 p.m. OK PyPy 3-64 TESTS 23 795 105062400
234329429 khanter_ E Nov. 25, 2023, 8:40 p.m. OK PyPy 3-64 TESTS 23 826 104550400
234350170 katonyonko E Nov. 26, 2023, 3:50 a.m. OK PyPy 3-64 TESTS 23 826 134860800
234302593 tamato E Nov. 25, 2023, 4:58 p.m. OK PyPy 3-64 TESTS 23 1231 104243200
234293081 dabbler1 E Nov. 25, 2023, 4:25 p.m. OK PyPy 3-64 TESTS 23 1310 128204800
234300012 titia E Nov. 25, 2023, 4:49 p.m. OK PyPy 3-64 TESTS 23 2620 256614400
234321732 kost E Nov. 25, 2023, 7:05 p.m. OK Rust 2021 TESTS 23 326 88473600

remove filters

Back to search problems