Codeforces Round 824 (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
1735 Codeforces Round 824 (Div. 2) FINISHED False 8100 67101899 Oct. 2, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20339 ) A Working Week PROGRAMMING constructive algorithms greedy math

B'Your working week consists of n days numbered from 1 to n , after day n goes day 1 again. And 3 of them are days off. One of the days off is the last day, day n . You have to decide when the other two are. Choosing days off, you pursue two goals: Output the maximum value of min(|l_1 - l_2|, |l_2 - l_3|, |l_3 - l_1|) that can be obtained. The first line of the input contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The description of test cases follows. The only line of each test case contains the integer n ( 6 <= n <= 10^9 ). For each test case, output one integer -- the maximum possible obtained value. In the image below you can see the example solutions for the first two test cases. Chosen days off are shown in purple. Working segments are underlined in green. In test case 1 , the only options for days off are days 2 , 3 , and 4 (because 1 and 5 are next to day n ). So the only way to place them without selecting neighboring days is to choose days 2 and 4 . Thus, l_1 = l_2 = l_3 = 1 , and the answer min(|l_1 - l_2|, |l_2 - l_3|, |l_3 - l_1|) = 0 . For test case 2 , one possible way to choose days off is shown. The working segments have the lengths of 2 , 1 , and 4 days. So the minimum difference is 1 = min(1, 3, 2) = min(|2 - 1|, |1 - 4|, |4 - 2|) . It can be shown that there is no way to make it larger. '...

Tutorials

Codeforces Round #824 — editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
174459120 chrisfcoder A Oct. 3, 2022, 2:02 a.m. OK C# 10 TESTS 6 108 0
174471712 zwu2021016671 A Oct. 3, 2022, 5:45 a.m. OK GNU C++14 TESTS 7 0 0
174471082 Freed0m8197 A Oct. 3, 2022, 5:36 a.m. OK GNU C++14 TESTS 7 0 0
174468508 vineethkumar552001 A Oct. 3, 2022, 4:59 a.m. OK GNU C++14 TESTS 7 0 0
174467267 SkyWalkerPS A Oct. 3, 2022, 4:39 a.m. OK GNU C++14 TESTS 7 0 0
174466860 kalavalarevanth A Oct. 3, 2022, 4:32 a.m. OK GNU C++14 TESTS 7 0 0
174465917 I_need_sleep A Oct. 3, 2022, 4:16 a.m. OK GNU C++14 TESTS 7 0 0
174465110 deadrohan19 A Oct. 3, 2022, 4:01 a.m. OK GNU C++14 TESTS 7 0 0
174464766 Tiny_Woodworm A Oct. 3, 2022, 3:54 a.m. OK GNU C++14 TESTS 7 0 0
174464447 butang A Oct. 3, 2022, 3:47 a.m. OK GNU C++14 TESTS 7 0 0
174463574 boen A Oct. 3, 2022, 3:30 a.m. OK GNU C++14 TESTS 7 0 0

remove filters

Back to search problems