CodeTON Round 2 (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
1704 CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 9000 72546899 July 31, 2022, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 93 ) H2 Game of AI (hard version) PROGRAMMING combinatorics fft math

B"This is the hard version of this problem. The difference between easy and hard versions is the constraint on k and the time limit. Notice that you need to calculate the answer for all positive integers n in [1,k] in this version. You can make hacks only if both versions of the problem are solved. Cirno is playing a war simulator game with n towers (numbered from 1 to n ) and n bots (numbered from 1 to n ). The i -th tower is initially occupied by the i -th bot for 1 <= i <= n . Before the game, Cirno first chooses a permutation p = [p_1, p_2, ldots, p_n] of length n (A permutation of length n is an array of length n where each integer between 1 and n appears exactly once). After that, she can choose a sequence a = [a_1, a_2, ldots, a_n] ( 1 <= a_i <= n and a_i ne i for all 1 <= i <= n ). The game has n rounds of attacks. In the i -th round, if the p_i -th bot is still in the game, it will begin its attack, and as the result the a_{p_i} -th tower becomes occupied by the p_i -th bot; the bot that previously occupied the a_{p_i} -th tower will no longer occupy it. If the p_i -th bot is not in the game, nothing will happen in this round. After each round, if a bot doesn't occupy any towers, it will be eliminated and leave the game. Please note that no tower can be occupied by more than one bot, but one bot can occupy more than one tower during the game. At the end of the game, Cirno will record the result as a sequence b = [b_1, b_2, ldots, b_n] , where b_i is the number of the bot that occupies the i -th tower at the end of the game. However, as a mathematics master, she wants you to solve the following counting problem instead of playing games: Count the number of different pairs of sequences a , b from all possible choices of sequence a and permutation p . "...

Tutorials

CodeTON Round 2 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
166424314 q-w-q-w-q H2 July 31, 2022, 11:59 p.m. OK GNU C++17 (64) TESTS 19 405 51507200
166424861 orzdevinwang H2 Aug. 1, 2022, 12:16 a.m. OK GNU C++17 (64) TESTS 19 7253 37478400
166416260 PinkieRabbit H2 July 31, 2022, 8:21 p.m. OK GNU C++20 (64) TESTS 19 6333 25600000
166416548 PinkieRabbit H2 July 31, 2022, 8:26 p.m. OK GNU C++20 (64) TESTS 19 6395 25600000

remove filters

Back to search problems