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 |
|---|---|---|---|---|---|---|
| 1776 | SWERC 2022-2023 - Online Mirror (Unrated, ICPC Rules, Teams Preferred) | FINISHED | False | 18000 | 99600923 | Feb. 19, 2023, 11:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1553 ) | B | Vittorio Plays with LEGO Bricks | PROGRAMMING | dp |
Vittorio is playing with his new LEGO Duplo bricks. All the bricks have the shape of a square cuboid with a (2 \times 2) square base and a height of (1). They can be arranged in the 3D space to build structures, provided that the following rules are met: No two bricks can intersect, but they can touch on their faces. The corners of every brick must have integer coordinates (so bricks are axis-aligned) and the (z) coordinates of all corners must be non-negative. The square bases of every brick must be parallel to the ground (i.e. the plane (z=0)). The lower base of any brick that is not touching the ground must touch the upper base of some other brick in a region of positive area (when this happens, the two bricks stay attached to each other thanks to small studs). For example, this is a valid structure: Vittorio wants to build a structure that includes purple bricks in the following (n) positions: ((x_1, 0, h)), ((x_2, 0, h)), (\dots), ((x_n, 0, h)) — these are the coordinates of the centers of their lower bases; note that all of these bricks have (y) coordinate equal to (0) and (z) coordinate equal to (h). Vittorio will use additional bricks of other colors to support the purple bricks. He is willing to place bricks only in positions where the center of the lower base has (y) coordinate equal to (0). What is the minimum number of additional bricks needed? It can be shown that a valid construction always exists. The first line contains two integers (n) and (h) ((1 \le n \le 300), (0 \le h \le 10^9)) — the number of purple bricks and their common (z) coordinate. The second line contains (n) integers (x_1, \, x_2, \, \dots, \, x_n) ((1 \le x_i \le 10^9), (x_i + 1 < x_{i+1})) — the (x) coordinates of the purple bricks (centers of the bases), given in increasing order. Print the minimum number of additional bricks needed. In the first sample , all the purple bri |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 194240675 | AC-Automation rui_er | B | Feb. 19, 2023, 2:18 p.m. | OK | GNU C++14 | TESTS | 48 | 31 | 716800 | ||
| 194232577 | Xu_Hongxi | B | Feb. 19, 2023, 1:16 p.m. | OK | GNU C++14 | TESTS | 48 | 31 | 716800 | ||
| 194229245 | PEIMUDA hyman00 bilibilitdasc | B | Feb. 19, 2023, 12:51 p.m. | OK | GNU C++14 | TESTS | 48 | 31 | 716800 | ||
| 194225763 | p6pou Krystallos william556 | B | Feb. 19, 2023, 12:26 p.m. | OK | GNU C++14 | TESTS | 48 | 31 | 716800 | ||
| 194295084 | __stick | B | Feb. 20, 2023, 12:20 a.m. | OK | GNU C++14 | TESTS | 48 | 31 | 819200 | ||
| 194267620 | glancing_back | B | Feb. 19, 2023, 5:46 p.m. | OK | GNU C++14 | TESTS | 48 | 31 | 921600 | ||
| 194247055 | Jimanbanashi | B | Feb. 19, 2023, 3:10 p.m. | OK | GNU C++14 | TESTS | 48 | 31 | 1536000 | ||
| 194232655 | daniel14311531 | B | Feb. 19, 2023, 1:16 p.m. | OK | GNU C++14 | TESTS | 48 | 31 | 1536000 | ||
| 194308607 | Jeese | B | Feb. 20, 2023, 4:45 a.m. | OK | GNU C++14 | TESTS | 48 | 46 | 716800 | ||
| 194244657 | wfjfjx zyc070419 Rebirth | B | Feb. 19, 2023, 2:51 p.m. | OK | GNU C++14 | TESTS | 48 | 46 | 716800 |
Back to search problems