Codeforces Round 766 (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
1627 Codeforces Round 766 (Div. 2) FINISHED False 7200 94922663 Jan. 15, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16809 ) B Not Sitting PROGRAMMING games greedy sortings

B"Rahul and Tina are looking forward to starting their new year at college. As they enter their new classroom, they observe the seats of students are arranged in a n x m grid. The seat in row r and column c is denoted by (r, c) , and the distance between two seats (a,b) and (c,d) is |a-c| + |b-d| . As the class president, Tina has access to exactly k buckets of pink paint. The following process occurs. Rahul wants to choose a seat such that he sits as close to Tina as possible. However, Tina wants to sit as far away from Rahul as possible due to some complicated relationship history that we couldn't fit into the statement! Now, Rahul wonders for k = 0, 1, ... , n cdot m - 1 , if Tina has k buckets of paint, how close can Rahul sit to Tina, if both Rahul and Tina are aware of each other's intentions and they both act as strategically as possible? Please help satisfy Rahul's curiosity! The input consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 5 cdot 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n , m ( 2 <= q n cdot m <= q 10^5 ) -- the number of rows and columns of seats in the classroom. The sum of n cdot m across all test cases does not exceed 10^5 . For each test case, output n cdot m ordered integers -- the distance between Rahul and Tina if both of them act optimally for every k in [0, n cdot m - 1] . One possible sequence of choices for the first testcase where Tina has k=3 buckets of paints is as follows. Tina paints the seats at positions (1, 2) , (2, 2) , (3, 2) with pink paint. Rahul chooses the seat at (3, 1) after which Tina chooses to sit at (1, 3) . Therefore, the distance between Tina and Rahul is |3-1| + |1-3| = 4 , and we can prove that this is indeed the m"...

Tutorials

Codeforces Round #766 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
142874619 daniil_volkov B Jan. 15, 2022, 4:22 p.m. OK FPC TESTS 17 312 2048000
142874206 liamaking B Jan. 15, 2022, 4:21 p.m. OK GNU C++14 TESTS 17 15 512000
142912133 37Lament B Jan. 16, 2022, 4:30 a.m. OK GNU C++14 TESTS 17 30 1126400
142907174 xuanxuan001 B Jan. 16, 2022, 2:24 a.m. OK GNU C++14 TESTS 17 31 0
142879984 wwch B Jan. 15, 2022, 4:34 p.m. OK GNU C++14 TESTS 17 31 0
142872935 Tahsin13 B Jan. 15, 2022, 4:18 p.m. OK GNU C++14 TESTS 17 31 204800
142884314 AWPer B Jan. 15, 2022, 5:15 p.m. OK GNU C++14 TESTS 17 31 409600
142917085 its7arc B Jan. 16, 2022, 5:56 a.m. OK GNU C++14 TESTS 17 31 409600
142912552 sapkalekaustubh87880 B Jan. 16, 2022, 4:39 a.m. OK GNU C++14 TESTS 17 31 409600
142907562 xgf B Jan. 16, 2022, 2:36 a.m. OK GNU C++14 TESTS 17 31 409600
142901705 lukamosiashvili B Jan. 15, 2022, 10:12 p.m. OK GNU C++14 TESTS 17 31 409600
142893872 suraj B Jan. 15, 2022, 7:04 p.m. OK .NET Core C# TESTS 17 93 5836800

remove filters

Back to search problems