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 |
|---|---|---|---|---|---|---|
| 2051 | Codeforces Round 995 (Div. 3) | FINISHED | False | 8100 | 41527523 | Dec. 22, 2024, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 2419 ) | G | Snakes | PROGRAMMING | bitmasks dp graphs |
Suppose you play a game where the game field looks like a strip of $$$1 \times 10^9$$$ square cells, numbered from $$$1$$$ to $$$10^9$$$. You have $$$n$$$ snakes (numbered from $$$1$$$ to $$$n$$$) you need to place into some cells. Initially, each snake occupies exactly one cell, and you can't place more than one snake into one cell. After that, the game starts. The game lasts for $$$q$$$ seconds. There are two types of events that may happen each second: snake $$$s_i$$$ enlarges : if snake $$$s_i$$$ occupied cells $$$[l, r]$$$, it enlarges to a segment $$$[l, r + 1]$$$; snake $$$s_i$$$ shrinks : if snake $$$s_i$$$ occupied cells $$$[l, r]$$$, it shrinks to a segment $$$[l + 1, r]$$$. Each second, exactly one of the events happens. If at any moment of time, any snake runs into some obstacle (either another snake or the end of the strip), you lose. Otherwise, you win with the score equal to the maximum cell occupied by any snake so far. What is the minimum possible score you can achieve? The first line contains two integers $$$n$$$ and $$$q$$$ ($$$1 \le n \le 20$$$; $$$1 \le q \le 2 \cdot 10^5$$$) — the number of snakes and the number of events. Next $$$q$$$ lines contain the description of events — one per line. The $$$i$$$-th line contains either "$$$s_i$$$ + " ($$$1 \le s_i \le n$$$) meaning that the $$$s_i$$$-th snake enlarges or "$$$s_i$$$ - " ($$$1 \le s_i \le n$$$) meaning that the $$$s_i$$$-th snake shrinks. Additional constraint on the input: the given sequence of events is valid, i. e. a snake of length $$$1$$$ never shrinks. Print one integer — the minimum possible score. In the first test, the optimal strategy is to place the second snake at cell $$$1$$$, the third snake — at $$$2$$$, and the first one — at $$$3$$$. The maximum occupied cell is cell $$$4$$$, and it's the minimum possible score. In the second test, one of the optimal strategies is to place: snake $$$2$$$ at position $$$1$$$; snake $$$3$$$ at position $$$4$$$; snake $$$5$$$ at pos |
| 137623 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 297966764 | amirhanordobaev | G | Dec. 22, 2024, 6:32 p.m. | OK | C# 10 | TESTS | 20 | 1749 | 88883200 | ||
| 297996504 | omeganot | G | Dec. 23, 2024, 4:52 a.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 827 | 84070400 | ||
| 297997128 | celin | G | Dec. 23, 2024, 5:01 a.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 827 | 113561600 | ||
| 297954391 | LiFuZhong | G | Dec. 22, 2024, 5:02 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 874 | 86528000 | ||
| 297999599 | fardin_khan_nur | G | Dec. 23, 2024, 5:33 a.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 890 | 88883200 | ||
| 297955602 | Zed1Yasoo | G | Dec. 22, 2024, 5:08 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 890 | 176537600 | ||
| 297953024 | tht.onepunchac168 | G | Dec. 22, 2024, 4:55 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 936 | 109875200 | ||
| 297992600 | Pbriwanttorecover | G | Dec. 23, 2024, 3:49 a.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 952 | 89907200 | ||
| 297999831 | dnodth | G | Dec. 23, 2024, 5:36 a.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 953 | 101990400 | ||
| 297953931 | kian2009 | G | Dec. 22, 2024, 5 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 968 | 505344000 | ||
| 297962195 | cjoa | G | Dec. 22, 2024, 5:52 p.m. | OK | C++17 (GCC 7-32) | TESTS | 20 | 983 | 88371200 | ||
| 297963947 | Eslam_Saleh | G | Dec. 22, 2024, 6:06 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 312 | 84070400 | ||
| 297964560 | Eslam_Saleh | G | Dec. 22, 2024, 6:12 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 343 | 80384000 | ||
| 297958309 | Damoonmah | G | Dec. 22, 2024, 5:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 514 | 193433600 | ||
| 297988591 | susvant | G | Dec. 23, 2024, 2:13 a.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 546 | 84070400 | ||
| 297949668 | N.N_2004 | G | Dec. 22, 2024, 4:48 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 562 | 126156800 | ||
| 297969025 | Kalashyan | G | Dec. 22, 2024, 6:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 593 | 88268800 | ||
| 297999054 | anarch_y | G | Dec. 23, 2024, 5:26 a.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 608 | 83558400 | ||
| 297959313 | hemanth6 | G | Dec. 22, 2024, 5:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 608 | 84070400 | ||
| 297964180 | Jakub_Woxniak | G | Dec. 22, 2024, 6:09 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 624 | 176537600 | ||
| 297952058 | bashkort | G | Dec. 22, 2024, 4:52 p.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 687 | 88371200 | ||
| 297957653 | neal | G | Dec. 22, 2024, 5:20 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 358 | 84070400 | ||
| 297957914 | neal | G | Dec. 22, 2024, 5:21 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 359 | 84172800 | ||
| 297955504 | kamulboyev__diyorbek | G | Dec. 22, 2024, 5:07 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 608 | 128102400 | ||
| 297954401 | kenkenken | G | Dec. 22, 2024, 5:02 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 624 | 84070400 | ||
| 297967540 | kyooz | G | Dec. 22, 2024, 6:39 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 687 | 181452800 | ||
| 297960345 | fishcathu | G | Dec. 22, 2024, 5:38 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 718 | 126566400 | ||
| 297951533 | CinaDor | G | Dec. 22, 2024, 4:49 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 733 | 88576000 | ||
| 297977793 | LoKl | G | Dec. 22, 2024, 8:55 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 796 | 128102400 | ||
| 297988719 | OutsiderZz | G | Dec. 23, 2024, 2:16 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 812 | 86323200 | ||
| 297966714 | aryanc403 | G | Dec. 22, 2024, 6:31 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 20 | 827 | 176230400 | ||
| 297988871 | vss2402001856 | G | Dec. 23, 2024, 2:21 a.m. | OK | Java 21 | TESTS | 20 | 2031 | 153395200 | ||
| 297984843 | MarcAS | G | Dec. 23, 2024, 12:01 a.m. | OK | Java 8 | TESTS | 20 | 2327 | 254361600 | ||
| 297984707 | MarcAS | G | Dec. 22, 2024, 11:56 p.m. | OK | Java 8 | TESTS | 20 | 2468 | 254361600 | ||
| 297983478 | MarcAS | G | Dec. 22, 2024, 11:10 p.m. | OK | Java 8 | TESTS | 20 | 2483 | 254361600 | ||
| 297979497 | MarcAS | G | Dec. 22, 2024, 9:26 p.m. | OK | Java 8 | TESTS | 20 | 2936 | 254464000 | ||
| 297976383 | LMeyling | G | Dec. 22, 2024, 8:33 p.m. | OK | PyPy 3-64 | TESTS | 20 | 2577 | 179814400 | ||
| 297968231 | MassimoG | G | Dec. 22, 2024, 6:47 p.m. | OK | PyPy 3-64 | TESTS | 20 | 2608 | 176435200 | ||
| 297968155 | misorin | G | Dec. 22, 2024, 6:46 p.m. | OK | PyPy 3-64 | TESTS | 20 | 2796 | 272588800 | ||
| 297986073 | MassimoG | G | Dec. 23, 2024, 12:51 a.m. | OK | PyPy 3-64 | TESTS | 20 | 2812 | 171110400 | ||
| 297986521 | pajenegod | G | Dec. 23, 2024, 1:07 a.m. | OK | PyPy 3-64 | TESTS | 20 | 2890 | 172236800 | ||
| 297986558 | pajenegod | G | Dec. 23, 2024, 1:08 a.m. | OK | PyPy 3-64 | TESTS | 20 | 2905 | 172236800 | ||
| 297986392 | pajenegod | G | Dec. 23, 2024, 1:03 a.m. | OK | PyPy 3-64 | TESTS | 20 | 2984 | 170496000 | ||
| 297953552 | titia | G | Dec. 22, 2024, 4:58 p.m. | OK | Rust 2021 | TESTS | 20 | 1468 | 239411200 | ||
| 297958977 | darkkcyan | G | Dec. 22, 2024, 5:28 p.m. | OK | Rust 2021 | TESTS | 20 | 1890 | 297779200 |
Back to search problems