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 |
|---|---|---|---|---|---|---|
| 2101 | Codeforces Round 1024 (Div. 1) | FINISHED | False | 9000 | 29431523 | May 11, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 270 ) | E | Kia Bakes a Cake | PROGRAMMING | data structures dp graphs greedy |
You are given a binary string (s) of length (n) and a tree (T) with (n) vertices. Let (k) be the number of 1 s in (s). We will construct a complete undirected weighted graph with (k) vertices as follows: For each (1\le i\le n) with (s_i = \mathtt{1}), create a vertex labeled (i). For any two vertices labeled (u) and (v) that are created in the above step, define the edge weight between them (w(u, v)) as the distance(^{\text{∗}}) between vertex (u) and vertex (v) in the tree (T). A simple path(^{\text{†}}) that visits vertices labeled (v_1, v_2, \ldots, v_m) in this order is nice if for all (1\le i\le m - 2), the condition (2\cdot w(v_i, v_{i + 1})\le w(v_{i + 1}, v_{i + 2})) holds. In other words, the weight of each edge in the path must be at least twice the weight of the previous edge. Note that (s_{v_i} = \mathtt{1}) has to be satisfied for all (1\le i\le m), as otherwise, there would be no vertex with the corresponding label. For each vertex labeled (i) ((1\le i\le n) and (s_i = \mathtt{1})) in the complete undirected weighted graph, determine the maximum number of vertices in any nice simple path starting from the vertex labeled (i). (^{\text{∗}})The distance between two vertices (a) and (b) in a tree is equal to the number of edges on the unique simple path between vertex (a) and vertex (b). (^{\text{†}})A path is a sequence of vertices (v_1, v_2, \ldots, v_m) such that there is an edge between (v_i) and (v_{i + 1}) for all (1\le i\le m - 1). A simple path is a path with no repeated vertices, i.e., (v_i\neq v_j) for all (1\le i < j\le m). 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 of each test case contains a single integer (n) ((1\le n\le 7\cdot10^4)) — |
| 142788 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 319265003 | xiaoziya | E | May 11, 2025, 3:51 p.m. | OK | C++17 (GCC 7-32) | TESTS | 103 | 2031 | 49356800 | ||
| 319311478 | maxplus | E | May 11, 2025, 10:37 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 671 | 42700800 | ||
| 319309524 | maxplus | E | May 11, 2025, 9:36 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 811 | 34099200 | ||
| 319298700 | maxplus | E | May 11, 2025, 6:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 1827 | 33280000 | ||
| 319285106 | xuanxuan001 | E | May 11, 2025, 4:47 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 3109 | 7065600 | ||
| 319261457 | Radewoosh | E | May 11, 2025, 3:44 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 3171 | 96768000 | ||
| 319286358 | Zanite | E | May 11, 2025, 4:51 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 3280 | 17408000 | ||
| 319299925 | JDScript0117 | E | May 11, 2025, 6:53 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 3531 | 7475200 | ||
| 319306365 | AlefHeKaaf | E | May 11, 2025, 8:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 3812 | 12697600 | ||
| 319302659 | kotatsugame | E | May 11, 2025, 7:30 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 3937 | 9420800 | ||
| 319271887 | tourist | E | May 11, 2025, 4:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 103 | 4155 | 20275200 | ||
| 319311488 | maxplus | E | May 11, 2025, 10:37 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 655 | 42803200 | ||
| 319306454 | 244mhq | E | May 11, 2025, 8:30 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 702 | 41062400 | ||
| 319260221 | hos.lyric | E | May 11, 2025, 3:44 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 780 | 36966400 | ||
| 319269195 | maspy | E | May 11, 2025, 4:01 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 1171 | 54579200 | ||
| 319295559 | Benq | E | May 11, 2025, 6:07 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 1327 | 43315200 | ||
| 319296384 | Swapil.Dey | E | May 11, 2025, 6:15 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 1562 | 43417600 | ||
| 319304297 | never_giveup | E | May 11, 2025, 7:54 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 1734 | 116940800 | ||
| 319294878 | Benq | E | May 11, 2025, 6:01 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 2061 | 47206400 | ||
| 319295780 | raincity | E | May 11, 2025, 6:10 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 2249 | 11161600 | ||
| 319294815 | peltorator | E | May 11, 2025, 6:01 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 103 | 2374 | 43315200 | ||
| 319325357 | muradbhai | E | May 12, 2025, 4:26 a.m. | OK | GNU C11 | TESTS | 103 | 4062 | 8601600 | ||
| 319281246 | rainboy | E | May 11, 2025, 4:35 p.m. | OK | GNU C11 | TESTS | 103 | 4155 | 40243200 | ||
| 319324628 | muradbhai | E | May 12, 2025, 4:14 a.m. | OK | GNU C11 | TESTS | 103 | 4671 | 8704000 |
Back to search problems