Codeforces Round 889 (Div. 1)

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
1854 Codeforces Round 889 (Div. 1) FINISHED False 9000 46538663 July 29, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 127 ) F Mark and Spaceship PROGRAMMING dp

B"Mark loves to move fast. So he made a spaceship that works in 4 -dimensional space. He wants to use the spaceship to complete missions as fast as possible. In each mission, the spaceship starts at (0, 0, 0, 0) and needs to end up at (a, b, c, d) . To do this, he instructs the spaceship's computer to execute a series of moves, where each move is a unit step in one of the eight cardinal directions: ( pm 1, 0, 0, 0) , (0, pm 1, 0, 0) , (0, 0, pm 1, 0) , (0, 0, 0, pm 1) . Unfortunately, he also moved fast when building the spaceship, so there is a bug in the spaceship's code. The first move will be executed once, the second move will be executed twice, the third move will be executed thrice, and so on. In general, the i -th move will be executed i times. For any four integers a, b, c, d , let f(a, b, c, d) be the minimum number of moves of a mission that ends up at (a, b, c, d) . Compute the sum of f(a, b, c, d) over all points (with integer coordinates) such that -A <= a <= A , -B <= b <= B , -C <= c <= C , -D <= d <= D . The only line of the input contains the four integers A, B, C, D ( 0 <= A,B,C,D <= 1000 ). Print the sum of f(a, b, c, d) over the set of points described in the statement. In the first sample, one has to compute f(-1, 0, 0, 0)+f(0, 0, 0, 0) + f(1, 0, 0, 0) = 1 + 0 + 1 = 2 . In the second sample, one has to compute the sum of f(a, b, c, d) over 27 different points (a, b, c, d) . Let us describe the value of f(a, b, c, d) for some of them: In the third sample, one has to compute the sum of f(a, b, c, d) over 7 cdot5 cdot 9 cdot 3 points. One of them is (3, 2, 4, 1) . It holds f(3, 2, 4, 1) = 4 and it may be achieved with the following sequence of moves: (0, 0, 0, 0) xrightarrow{+4} (0, 0, 0, 1) xrightarrow{+2} (0, 2, 0, 1) xrightarrow{+1} (3, 2, 0, 1) xrightarrow{+3} (3, 2, 4"...

Tutorials

Editorial of Codeforces Round 889 (Div. 1 + Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
216364210 Benq F July 29, 2023, 8:14 p.m. OK GNU C++17 (64) TESTS 18 343 14643200
216385529 xieqiankun6666 F July 30, 2023, 2:25 a.m. OK GNU C++20 (64) TESTS 18 873 44851200
216373971 Radewoosh F July 29, 2023, 10:20 p.m. OK GNU C++20 (64) TESTS 18 873 44851200
216386912 5af F July 30, 2023, 2:46 a.m. OK GNU C++20 (64) TESTS 18 982 44851200
216373153 Petr F July 29, 2023, 10:06 p.m. OK GNU C++20 (64) TESTS 18 2292 65126400

remove filters

Back to search problems