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 |
|---|---|---|---|---|---|---|
| ( 892 ) | I | Spinach Pizza | PROGRAMMING | games geometry greedy interactive |
The two siblings Alberto and Beatrice have to eat a spinach pizza together. However, none of them likes spinach, so they both want to eat as little as possible. The pizza has the shape of a strictly convex polygon with (n) vertices located at integer coordinates ((x_1, y_1), \, (x_2, y_2), \, \dots, \, (x_n, y_n)) of the plane. The siblings have decided to eat the pizza in the following way: taking turns, starting with Alberto, each sibling chooses a vertex of the remaining part of the pizza and eats out the triangle determined by its two neighboring edges. In this way, after each of the first (n - 3) turns the pizza will have one less vertex. The game ends after the ((n - 2))-th turn, when all the pizza has been eaten. Assuming that Alberto and Beatrice choose the slices to eat optimally, which of the siblings manages to eat at most half of the pizza? You should identify a sibling that has a strategy to do so and help them choose the slices appropriately. Note that it is possible that both Alberto and Beatrice end up eating exactly half of the area if they choose their slices optimally. The first line contains a single integer (n) ((4 \le n \le 100)) — the number of vertices. The next (n) lines contain two integers (x_i) and (y_i) each ((-10^6 \le x_i, y_i \le 10^6)) — the coordinates of the (i)-th vertex of the polygon representing the initial shape of the pizza. It is guaranteed that the polygon is strictly convex and that its vertices are given in counterclockwise order. First, you should print a line containing either the string (Alberto) or the string (Beatrice) — the sibling that you will help to win. Then, for the next (n - 2) turns, you will alternate with the judge in choosing a slice of the pizza and removing it, starting with you if you chose to help Alberto, or starting with the judge if you chose to help Beatrice. When it is your turn, print a single line containing an |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 194307321 | Rosemary | I | Feb. 20, 2023, 4:16 a.m. | OK | GNU C++14 | TESTS | 51 | 15 | 0 | ||
| 194250673 | p6pou Krystallos william556 | I | Feb. 19, 2023, 3:40 p.m. | OK | GNU C++14 | TESTS | 51 | 15 | 0 | ||
| 194249324 | bdzzj _Diu_ Flew | I | Feb. 19, 2023, 3:29 p.m. | OK | GNU C++14 | TESTS | 51 | 15 | 0 | ||
| 194245085 | daniel14311531 | I | Feb. 19, 2023, 2:54 p.m. | OK | GNU C++14 | TESTS | 51 | 15 | 0 | ||
| 194241782 | mydcwfy Qiuly.qwq themoon | I | Feb. 19, 2023, 2:27 p.m. | OK | GNU C++14 | TESTS | 51 | 15 | 0 | ||
| 194233026 | hank55663 | I | Feb. 19, 2023, 1:19 p.m. | OK | GNU C++14 | TESTS | 51 | 15 | 102400 | ||
| 194239336 | WhaleAutoMaton _ReClouds_ Danewol | I | Feb. 19, 2023, 2:08 p.m. | OK | GNU C++14 | TESTS | 51 | 15 | 204800 | ||
| 194241521 | Potassium | I | Feb. 19, 2023, 2:25 p.m. | OK | GNU C++14 | TESTS | 51 | 15 | 307200 |
Back to search problems