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 |
|---|---|---|---|---|---|---|
| 2063 | Codeforces Round 1000 (Div. 2) | FINISHED | False | 7200 | 38858123 | Jan. 22, 2025, 12:05 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 4991 ) | D | Game With Triangles | PROGRAMMING | binary search data structures dp greedy math ternary search two pointers |
There are (n+m) distinct points ((a_1,0), (a_2,0), \ldots, (a_{n},0), (b_1,2), (b_2,2), \ldots, (b_{m},2)) on the plane. Initially, your score is (0). To increase your score, you can perform the following operation: Choose three distinct points which are not collinear ; Increase your score by the area of the triangle formed by these three points; Then, erase the three points from the plane. Let (k_{\max}) be the maximum number of operations that can be performed. For example, if it is impossible to perform any operation, (k_\max) is (0). Additionally, define (f(k)) as the maximum possible score achievable by performing the operation exactly (k) times . Here, (f(k)) is defined for all integers (k) such that (0 \le k \le k_{\max}). Find the value of (k_{\max}), and find the values of (f(x)) for all integers (x=1,2,\ldots,k_{\max}) independently. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le {3 \cdot 10^4})). The description of the test cases follows. The first line of each test case contains two integers (n) and (m) ((1 \le n,m \le 2 \cdot 10^5)). The second line of each test case contains (n) pairwise distinct integers (a_1,a_2,\ldots,a_{n}) — the points on (y=0) ((-10^9 \le a_i \le 10^9)). The third line of each test case contains (m) pairwise distinct integers (b_1,b_2,\ldots,b_{m}) — the points on (y=2) ((-10^9 \le b_i \le 10^9)). It is guaranteed that both the sum of (n) and the sum of (m) over all test cases do not exceed (2 \cdot 10^5). For each test case, given that the maximum number of operations is (k_{\max}), you must output at most two lines: The first line contains the value of (k_{\max}); The second line contains (k_{\max}) integers denoting (f(1),f(2),\ldots,f(k_{\max})). You are allowed to omit this line if (k_{\max}) is (0). Note that unde |
| Codeforces Round 1000 (Div. 2) — Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 302522051 | Anastasiya_Andreevna | D | Jan. 22, 2025, 10:06 p.m. | OK | C# 10 | TESTS | 30 | 530 | 68403200 | ||
| 302535666 | LastingForever | D | Jan. 23, 2025, 2:37 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 202 | 1126400 | ||
| 302469686 | yuyc | D | Jan. 22, 2025, 3:06 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 202 | 2150400 | ||
| 302543671 | KingOfThisWorld | D | Jan. 23, 2025, 4:26 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 202 | 3481600 | ||
| 302493980 | -adhd- | D | Jan. 22, 2025, 5:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 203 | 102400 | ||
| 302535346 | LastingForever | D | Jan. 23, 2025, 2:31 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 203 | 1126400 | ||
| 302523703 | 9G_ppllxx | D | Jan. 22, 2025, 10:44 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 203 | 1638400 | ||
| 302472555 | vladburac | D | Jan. 22, 2025, 3:19 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 203 | 9625600 | ||
| 302523072 | antekn | D | Jan. 22, 2025, 10:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 217 | 6451200 | ||
| 302527643 | Citypop | D | Jan. 23, 2025, 12:21 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 218 | 512000 | ||
| 302516969 | TsotneSV | D | Jan. 22, 2025, 8:38 p.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 218 | 1024000 | ||
| 302467032 | FuDiWeiu | D | Jan. 22, 2025, 2:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 109 | 11366400 | ||
| 302534957 | GALA | D | Jan. 23, 2025, 2:25 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 140 | 102400 | ||
| 302534780 | dbGIs | D | Jan. 23, 2025, 2:22 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 140 | 1945600 | ||
| 302539240 | xu826281112 | D | Jan. 23, 2025, 3:26 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 140 | 6246400 | ||
| 302484189 | dmraykhan | D | Jan. 22, 2025, 4:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 155 | 0 | ||
| 302545743 | zus123 | D | Jan. 23, 2025, 4:53 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 155 | 614400 | ||
| 302513402 | SaltyDonut | D | Jan. 22, 2025, 7:51 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 155 | 1126400 | ||
| 302513347 | SaltyDonut | D | Jan. 22, 2025, 7:50 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 155 | 1126400 | ||
| 302520843 | asterisk11 | D | Jan. 22, 2025, 9:43 p.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 155 | 3584000 | ||
| 302526656 | LipArcanjo | D | Jan. 23, 2025, 12:01 a.m. | OK | C++20 (GCC 13-64) | TESTS | 30 | 155 | 4300800 | ||
| 302546761 | OTTFF | D | Jan. 23, 2025, 5:05 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 155 | 102400 | ||
| 302533344 | sgfc | D | Jan. 23, 2025, 1:57 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 155 | 716800 | ||
| 302480887 | 424479543 | D | Jan. 22, 2025, 4:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 155 | 1945600 | ||
| 302468388 | 26100154 | D | Jan. 22, 2025, 3:01 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 155 | 2048000 | ||
| 302516002 | run2wice | D | Jan. 22, 2025, 8:23 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 156 | 102400 | ||
| 302525258 | klein199 | D | Jan. 22, 2025, 11:23 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 156 | 102400 | ||
| 302502668 | FzArK | D | Jan. 22, 2025, 6:19 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 156 | 102400 | ||
| 302519280 | Kanaifu | D | Jan. 22, 2025, 9:14 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 156 | 1228800 | ||
| 302545412 | lichenyu_ac | D | Jan. 23, 2025, 4:49 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 156 | 1638400 | ||
| 302517256 | rgnerdplayer | D | Jan. 22, 2025, 8:42 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 30 | 156 | 3584000 | ||
| 302526902 | rainboy | D | Jan. 23, 2025, 12:06 a.m. | OK | GNU C11 | TESTS | 30 | 827 | 1740800 | ||
| 302484607 | lyongwolf | D | Jan. 22, 2025, 4:26 p.m. | OK | Java 21 | TESTS | 30 | 359 | 1126400 | ||
| 302461520 | _firstexception | D | Jan. 22, 2025, 2:04 p.m. | OK | Java 21 | TESTS | 30 | 577 | 77107200 | ||
| 302467108 | limbo_1 | D | Jan. 22, 2025, 2:56 p.m. | OK | Java 21 | TESTS | 30 | 624 | 20172800 | ||
| 302500634 | sahasrad | D | Jan. 22, 2025, 6:06 p.m. | OK | Java 21 | TESTS | 30 | 671 | 7065600 | ||
| 302461138 | codewithme.kartik | D | Jan. 22, 2025, 2:04 p.m. | OK | Java 21 | TESTS | 30 | 1515 | 9932800 | ||
| 302460379 | Krishna_Murari_30 | D | Jan. 22, 2025, 2:03 p.m. | OK | Java 8 | TESTS | 30 | 1296 | 3276800 | ||
| 302460310 | infinite_oo_loop | D | Jan. 22, 2025, 2:03 p.m. | OK | Java 8 | TESTS | 30 | 1312 | 3379200 | ||
| 302468473 | SPD_9X2 | D | Jan. 22, 2025, 3:01 p.m. | OK | PyPy 3 | TESTS | 30 | 1187 | 30924800 | ||
| 302492334 | golomb | D | Jan. 22, 2025, 5:14 p.m. | OK | PyPy 3 | TESTS | 30 | 1264 | 24268800 | ||
| 302539746 | gardengnome | D | Jan. 23, 2025, 3:32 a.m. | OK | PyPy 3-64 | TESTS | 30 | 281 | 35225600 | ||
| 302491972 | x3mka | D | Jan. 22, 2025, 5:12 p.m. | OK | PyPy 3-64 | TESTS | 30 | 311 | 38502400 | ||
| 302540400 | gardengnome | D | Jan. 23, 2025, 3:41 a.m. | OK | PyPy 3-64 | TESTS | 30 | 327 | 34201600 | ||
| 302540113 | gardengnome | D | Jan. 23, 2025, 3:37 a.m. | OK | PyPy 3-64 | TESTS | 30 | 327 | 34508800 | ||
| 302491680 | akioweh | D | Jan. 22, 2025, 5:10 p.m. | OK | PyPy 3-64 | TESTS | 30 | 359 | 37171200 | ||
| 302482425 | Anav_Agrawal | D | Jan. 22, 2025, 4:12 p.m. | OK | PyPy 3-64 | TESTS | 30 | 359 | 44032000 | ||
| 302525694 | OpKos | D | Jan. 22, 2025, 11:35 p.m. | OK | PyPy 3-64 | TESTS | 30 | 374 | 37683200 | ||
| 302489038 | akioweh | D | Jan. 22, 2025, 4:53 p.m. | OK | PyPy 3-64 | TESTS | 30 | 374 | 41267200 | ||
| 302485434 | PhoenixKiller | D | Jan. 22, 2025, 4:31 p.m. | OK | PyPy 3-64 | TESTS | 30 | 375 | 55603200 | ||
| 302470988 | DeepJ | D | Jan. 22, 2025, 3:12 p.m. | OK | PyPy 3-64 | TESTS | 30 | 389 | 38707200 | ||
| 302492674 | akioweh | D | Jan. 22, 2025, 5:16 p.m. | OK | Python 3 | TESTS | 30 | 467 | 48435200 | ||
| 302474569 | e_yi | D | Jan. 22, 2025, 3:28 p.m. | OK | Python 3 | TESTS | 30 | 640 | 53350400 | ||
| 302498598 | kalinov | D | Jan. 22, 2025, 5:52 p.m. | OK | Rust 2021 | TESTS | 30 | 186 | 2048000 | ||
| 302461142 | w1ntr | D | Jan. 22, 2025, 2:04 p.m. | OK | Rust 2021 | TESTS | 30 | 218 | 7270400 |
Back to search problems