Codeforces Global Round 16

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
1566 Codeforces Global Round 16 FINISHED False 9000 105722662 Sept. 12, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14127 ) D1 Seating Arrangements (easy version) PROGRAMMING data structures greedy sortings

B"It is the easy version of the problem. The only difference is that in this version n = 1 . In the cinema seats can be represented as the table with n rows and m columns. The rows are numbered with integers from 1 to n . The seats in each row are numbered with consecutive integers from left to right: in the k -th row from m (k - 1) + 1 to m k for all rows 1 <= k <= n . There are nm people who want to go to the cinema to watch a new film. They are numbered with integers from 1 to nm . You should give exactly one seat to each person. It is known, that in this cinema as lower seat index you have as better you can see everything happening on the screen. i -th person has the level of sight a_i . Let's define s_i as the seat index, that will be given to i -th person. You want to give better places for people with lower sight levels, so for any two people i , j such that a_i < a_j it should be satisfied that s_i < s_j . After you will give seats to all people they will start coming to their seats. In the order from 1 to nm , each person will enter the hall and sit in their seat. To get to their place, the person will go to their seat's row and start moving from the first seat in this row to theirs from left to right. While moving some places will be free, some will be occupied with people already seated. The inconvenience of the person is equal to the number of occupied seats he or she will go through. Let's consider an example: m = 5 , the person has the seat 4 in the first row, the seats 1 , 3 , 5 in the first row are already occupied, the seats 2 and 4 are free. The inconvenience of this person will be 2 , because he will go through occupied seats 1 and 3 . Find the minimal total inconvenience (the sum of inconveniences of all people), that is possible to have by giving places for all p"...

Tutorials

Codeforces Global Round 16 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
128686388 gxlois D1 Sept. 13, 2021, 2:06 a.m. OK D TESTS 16 46 10956800
128651766 ssvb D1 Sept. 12, 2021, 4:24 p.m. OK D TESTS 16 62 10956800
128683590 Anhng.194 D1 Sept. 13, 2021, 12:37 a.m. OK FPC TESTS 16 46 3481600
128660476 PAG D1 Sept. 12, 2021, 4:57 p.m. OK FPC TESTS 16 46 5017600
128649497 snapiproof D1 Sept. 12, 2021, 4:16 p.m. OK .NET Core C# TESTS 16 124 15052800

remove filters

Back to search problems