Squarepoint Challenge (Codeforces Round 1055, 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
2152 Squarepoint Challenge (Codeforces Round 1055, Div. 1 + Div. 2) FINISHED False 10800 16903523 Oct. 3, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 580 ) H1 Victorious Coloring (Easy Version) PROGRAMMING dp graphs

This is the easy version of the problem. The difference between the versions is that in this version, (q \le 10). You can hack only if you solved all versions of this problem. You are given a tree with (n) vertices, where each vertex is numbered from (1) to (n). Each edge is assigned a positive integer weight (w_1, w_2, \ldots, w_{n-1}) as well. A victorious coloring is a coloring of each vertex into two colors: red and yellow , where there should be at least one vertex colored in red (corresponding to the symbol of team T1). Suppose that there is a nonnegative integer weight (x_1, x_2, \ldots, x_n) assigned to each vertex. The cost of the victorious coloring is defined as the sum of the weights of all red vertices, plus the sum of the weights of all edges that connect vertices of different colors (between red and yellow). We define (f(x_1, x_2, \ldots, x_n)) as the minimum possible cost for all victorious colorings. Gumayusi considered the problem of computing (f(x_1, x_2, \ldots, x_n)), given the sequence (x_1, x_2, \ldots, x_n). However, this problem was too easy for him, so he devised a variation: Given an integer (l), find a sequence of nonnegative integer vertex weights (x_1, x_2, \ldots, x_n) such that (f(x_1, x_2, \ldots, x_n) \ge l) and the total sum (\sum_{i=1}^n x_i) is minimized. Gumayusi was satisfied, but there was a serious issue — this problem doesn't have any queries, which is a necessary component for any problem that isn't bad. So, he added queries to this problem. For each (l) given as a query, you must find the corresponding minimum possible sum of vertex weights. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line contains an integer (n) ((2 \le n \le 250\,000)) — the number of vertices. The following (n-1) lines contain three intege

Tutorials

Squarepoint Challenge (Codeforces Round 1055, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
341762615 Maverick027 H1 Oct. 3, 2025, 10:36 p.m. OK C++17 (GCC 7-32) TESTS 33 390 22220800
341756642 LastMagician H1 Oct. 3, 2025, 8:40 p.m. OK C++17 (GCC 7-32) TESTS 33 561 19251200
341759007 LastMagician H1 Oct. 3, 2025, 9:15 p.m. OK C++17 (GCC 7-32) TESTS 33 780 106905600
341737661 jose_mourinho H1 Oct. 3, 2025, 5:33 p.m. OK C++17 (GCC 7-32) TESTS 33 796 20480000
341729024 diplomatic_solver H1 Oct. 3, 2025, 5:06 p.m. OK C++17 (GCC 7-32) TESTS 33 796 21913600
341729846 lotusblume H1 Oct. 3, 2025, 5:09 p.m. OK C++17 (GCC 7-32) TESTS 33 828 29593600
341735855 potato167 H1 Oct. 3, 2025, 5:28 p.m. OK C++17 (GCC 7-32) TESTS 33 858 26009600
341730661 Watersphere H1 Oct. 3, 2025, 5:12 p.m. OK C++17 (GCC 7-32) TESTS 33 905 19763200
341736623 pranas H1 Oct. 3, 2025, 5:30 p.m. OK C++17 (GCC 7-32) TESTS 33 905 27033600
341725461 fft_ntt H1 Oct. 3, 2025, 4:55 p.m. OK C++17 (GCC 7-32) TESTS 33 1046 33996800
341768220 emachieng H1 Oct. 4, 2025, 1:23 a.m. OK C++20 (GCC 13-64) TESTS 33 265 23142400
341760065 Dominater069 H1 Oct. 3, 2025, 9:35 p.m. OK C++20 (GCC 13-64) TESTS 33 327 26419200
341776231 nullptr_qwq H1 Oct. 4, 2025, 3:26 a.m. OK C++20 (GCC 13-64) TESTS 33 343 15257600
341724836 mtsd H1 Oct. 3, 2025, 4:53 p.m. OK C++20 (GCC 13-64) TESTS 33 358 7475200
341726331 BurnedChicken H1 Oct. 3, 2025, 4:58 p.m. OK C++20 (GCC 13-64) TESTS 33 437 5427200
341782167 CHATTY-Bebob H1 Oct. 4, 2025, 4:46 a.m. OK C++20 (GCC 13-64) TESTS 33 561 10035200
341770831 thomaswmy H1 Oct. 4, 2025, 2:10 a.m. OK C++20 (GCC 13-64) TESTS 33 561 10035200
341720458 _.Ali._ H1 Oct. 3, 2025, 4:41 p.m. OK C++20 (GCC 13-64) TESTS 33 593 29696000
341722378 RSMT98 H1 Oct. 3, 2025, 4:46 p.m. OK C++20 (GCC 13-64) TESTS 33 593 30924800
341743369 platter H1 Oct. 3, 2025, 6:31 p.m. OK C++20 (GCC 13-64) TESTS 33 702 7475200
341767864 ibr-abd H1 Oct. 4, 2025, 1:15 a.m. OK C++23 (GCC 14-64, msys2) TESTS 33 359 9318400
341750566 MoneyCalling H1 Oct. 3, 2025, 7:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 33 390 12083200
341736856 yahia H1 Oct. 3, 2025, 5:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 33 452 13414400
341735580 maspy H1 Oct. 3, 2025, 5:27 p.m. OK C++23 (GCC 14-64, msys2) TESTS 33 546 30720000
341771549 DangHoaNguyen H1 Oct. 4, 2025, 2:21 a.m. OK C++23 (GCC 14-64, msys2) TESTS 33 561 116633600
341735026 ckuhn222theend H1 Oct. 3, 2025, 5:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 33 593 31948800
341725765 __builtin_gjr H1 Oct. 3, 2025, 4:56 p.m. OK C++23 (GCC 14-64, msys2) TESTS 33 608 15257600
341738285 xuyiluo2 H1 Oct. 3, 2025, 5:34 p.m. OK C++23 (GCC 14-64, msys2) TESTS 33 624 50380800
341759674 lyteabovenyte H1 Oct. 3, 2025, 9:26 p.m. OK C++23 (GCC 14-64, msys2) TESTS 33 640 32972800
341754712 ecnerwala H1 Oct. 3, 2025, 8:17 p.m. OK C++23 (GCC 14-64, msys2) TESTS 33 671 27545600
341724774 arvindf232 H1 Oct. 3, 2025, 4:53 p.m. OK Kotlin 2.2 TESTS 33 921 23040000

remove filters

Back to search problems