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
( 18295 ) B Tea with Tangerines PROGRAMMING greedy math

B"There are n pieces of tangerine peel, the i -th of them has size a_i . In one step it is possible to divide one piece of size x into two pieces of positive integer sizes y and z so that y + z = x . You want that for each pair of pieces, their sizes differ strictly less than twice. In other words, there should not be two pieces of size x and y , such that 2x <= y . What is the minimum possible number of steps needed to satisfy the condition? The first line of the input contains a single integer t ( 1 <= t <= 100 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains the integer n ( 1 <= n <= 100 ). Then one line follows, containing n integers a_1 <= a_2 <= ldots <= a_n ( 1 <= a_i <= 10^7 ). For each test case, output a single line containing the minimum number of steps. In the first test case, we initially have a piece of size 1 , so all final pieces must have size 1 . The total number of steps is: 0 + 1 + 2 + 3 + 4 = 10 . In the second test case, we have just one piece, so we don't need to do anything, and the answer is 0 steps. In the third test case, one of the possible cut options is: 600, 900, (600 | 700), (1000 | 1000), (1000 | 1000 | 550) . You can see this option in the picture below. The maximum piece has size 1000 , and it is less than 2 times bigger than the minimum piece of size 550 . 4 steps are done. We can show that it is the minimum possible number of steps. "...

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
174419557 singhkrishnajsr143 B Oct. 2, 2022, 4:16 p.m. OK C# 10 TESTS 6 46 614400
174417632 Yusif B Oct. 2, 2022, 4:09 p.m. OK C# 10 TESTS 6 187 614400
174444490 JK_K B Oct. 2, 2022, 7:46 p.m. OK Clang++17 Diagnostics TESTS 7 62 0
174458838 closed_doors B Oct. 3, 2022, 1:56 a.m. OK GNU C++14 TESTS 7 0 0
174455985 HyperSQ B Oct. 3, 2022, 12:38 a.m. OK GNU C++14 TESTS 7 0 0
174435004 yatharth570 B Oct. 2, 2022, 5:53 p.m. OK GNU C++14 TESTS 7 0 0
174426330 RUET_1903121 B Oct. 2, 2022, 4:43 p.m. OK GNU C++14 TESTS 6 0 0
174420335 YellowCoder26 B Oct. 2, 2022, 4:19 p.m. OK GNU C++14 TESTS 6 0 0
174418762 muhamed_amr B Oct. 2, 2022, 4:13 p.m. OK GNU C++14 TESTS 6 0 0
174421927 aj-322-cf B Oct. 2, 2022, 4:25 p.m. OK GNU C++14 TESTS 6 0 102400
174417969 carloscerlira B Oct. 2, 2022, 4:10 p.m. OK GNU C++14 TESTS 6 0 102400
174461875 xsdjg B Oct. 3, 2022, 2:58 a.m. OK GNU C++14 TESTS 7 0 921600
174471391 noob16 B Oct. 3, 2022, 5:40 a.m. OK GNU C++14 TESTS 7 15 0

remove filters

Back to search problems