Codeforces Global Round 29 (Div. 1 + 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
2147 Codeforces Global Round 29 (Div. 1 + Div. 2) FINISHED False 10800 18026723 Sept. 20, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 102 ) I2 Longest Increasing Path (Hard Version) PROGRAMMING constructive algorithms

This is the hard version of the problem. The difference between the versions is that in this version the second test is (n=300\,000). Hacks are not allowed in this problem. Let's call an integer sequence (a_1, a_2, \ldots, a_n) distance-convex if (|a_{i} - a_{i-1}| < |a_{i+1} - a_{i}|) for every (1 < i < n). In other words, if you jump through the points (a_1, a_2, \ldots, a_n) in this order, each next jump is strictly longer than the previous one. You are given two integers (n) and (m). Find a distance-convex sequence (a) of length (n) that contains at most (m) distinct values . In terms of the jump sequence, that would mean that you need to make ((n-1)) jumps of increasing lengths while visiting at most (m) distinct points. (-10^{18} \le a_i \le 10^{18}) should hold for all (1 \le i \le n). Input consists of two integers (n) and (m). There are only 2 tests for this problem. (n = 8), (m = 6); (n = 300\,000), (m = 15\,000). Hacks are not allowed in this problem. Print a distance-convex sequence (a_1, a_2, \ldots, a_n) that contains at most (m) distinct values. (-10^{18} \le a_i \le 10^{18}) should hold for all (1 \le i \le n). If there are multiple solutions, print any of them. The sequence (1, 1, 3, 6, 10, 3, 11, 1) has length (n=8) and contains (5) different values, which is less than or equal to (m=6). The differences between consecutive values are (0,2,3,4,7,8,10), a strictly increasing sequence. (1, 1, 2, 4, 8, 16, 32, 1) would be another valid answer.

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
339614813 TheOrangeNyan I2 Sept. 20, 2025, 7:04 p.m. OK C++17 (GCC 7-32) TESTS 2 108 5734400
339611687 Ak_16 I2 Sept. 20, 2025, 6:45 p.m. OK C++17 (GCC 7-32) TESTS 2 109 24166400
339654461 gooonn I2 Sept. 21, 2025, 5:43 a.m. OK C++17 (GCC 7-32) TESTS 2 124 5017600
339611379 potato167 I2 Sept. 20, 2025, 6:43 p.m. OK C++17 (GCC 7-32) TESTS 2 139 2560000
339594124 lotusblume I2 Sept. 20, 2025, 5:05 p.m. OK C++17 (GCC 7-32) TESTS 2 156 2764800
339644808 __akash24_13 I2 Sept. 21, 2025, 3:26 a.m. OK C++23 (GCC 14-64, msys2) TESTS 2 46 3686400
339641166 sarbansah0410 I2 Sept. 21, 2025, 2:13 a.m. OK C++23 (GCC 14-64, msys2) TESTS 2 61 4915200
339645492 RadheKrisna I2 Sept. 21, 2025, 3:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 2 77 3584000
339615262 Benq I2 Sept. 20, 2025, 7:07 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 77 3686400
339617938 wh01sShakin I2 Sept. 20, 2025, 7:27 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 93 3584000
339616281 treebutton I2 Sept. 20, 2025, 7:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 2 93 4915200
339646911 strapple I2 Sept. 21, 2025, 4:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 2 187 32153600
339646874 strapple I2 Sept. 21, 2025, 4:05 a.m. OK C++23 (GCC 14-64, msys2) TESTS 2 202 64409600
339632495 rainboy I2 Sept. 20, 2025, 9:58 p.m. OK GNU C11 TESTS 2 1311 4812800
339645950 zouyu9631 I2 Sept. 21, 2025, 3:48 a.m. OK PyPy 3-64 TESTS 2 218 30208000

remove filters

Back to search problems