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 |
|---|---|---|---|---|---|---|
| 2238 | Codeforces Round 1106 (Div. 2) | FINISHED | False | 7200 | 3252310 | June 28, 2026, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1836 ) | E | Cake Trial | PROGRAMMING | dp greedy two pointers |
GLaDOS, the artificial intelligence of the Aperture Science Enrichment Center, decided to conduct another test for Chell. This time, the test is about cakes. GLaDOS arranged (n) cakes in a row. Each cake can be either real ( T ) or fake ( F ). Chell must guess which cakes are real and which are fake. Chell has a unique ability: she can determine exactly whether a cake is real just by looking at it. However, in her answer, she must satisfy GLaDOS's strange condition: all fake cakes in Chell's answer must form one contiguous subsegment (possibly empty). Initially, GLaDOS prepared some arrangement of cakes, but some cakes have not been placed yet. You are given a string (s) of length (n) describing the current situation: (s_i =) T , if the (i)-th cake is real; (s_i =) F , if the (i)-th cake is fake; (s_i =) N , if there is no cake at the (i)-th position yet, and GLaDOS may still place either a real or a fake cake there at her discretion. GLaDOS, being cunning, wants to make Chell's life harder. She wants to place the remaining cakes (replace all N with T or F ) so that the number of mistakes Chell is forced to make, under her optimal choice of segment, is as large as possible. Help GLaDOS determine the maximum number of mistakes she can guarantee. 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 one integer (n) ((1 \le n \le 500)) — the number of cakes. The second line of each test case contains a string (s) of length (n) consisting of the characters T , F , or N — the current arrangement of cakes. It is guaranteed that the sum of (n^3) over all test cases does not exceed (500^3). For each test case, output one integer — the maximum number of mistakes that GLaDOS can guarantee. In the first test case, (s =) FTFF , all cakes are already plac |
| Codeforces Round 1106 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 380504349 | sronak | E | June 28, 2026, 3:52 p.m. | OK | C# 13 | TESTS | 31 | 328 | 3686400 | ||
| 380515625 | SujalBansal15 | E | June 28, 2026, 4:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 46 | 0 | ||
| 380507674 | forest | E | June 28, 2026, 4:03 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 78 | 0 | ||
| 380512648 | lokesh_916 | E | June 28, 2026, 4:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 78 | 2048000 | ||
| 380520402 | kenapa | E | June 28, 2026, 5:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 93 | 0 | ||
| 380513457 | 24je0235 | E | June 28, 2026, 4:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 93 | 2048000 | ||
| 380514054 | isourxbh | E | June 28, 2026, 4:28 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 125 | 102400 | ||
| 380515704 | Patrick_St1r | E | June 28, 2026, 4:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 125 | 1126400 | ||
| 380509663 | NabilTheLegend | E | June 28, 2026, 4:11 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 125 | 2048000 | ||
| 380499790 | FdHasd | E | June 28, 2026, 3:37 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 125 | 2048000 | ||
| 380536052 | antguz | E | June 28, 2026, 10:29 p.m. | OK | C++17 (GCC 7-32) | TESTS | 31 | 125 | 2150400 | ||
| 380524134 | timg8710 | E | June 28, 2026, 6:13 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 46 | 0 | ||
| 380512324 | Payea | E | June 28, 2026, 4:21 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 78 | 2150400 | ||
| 380511312 | AayushMT_2520 | E | June 28, 2026, 4:17 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 93 | 2048000 | ||
| 380503587 | bellelli | E | June 28, 2026, 3:49 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 93 | 2048000 | ||
| 380502800 | zhichenlin | E | June 28, 2026, 3:47 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 93 | 2150400 | ||
| 380514176 | NHANGIOI | E | June 28, 2026, 4:29 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 93 | 2969600 | ||
| 380498173 | Re-Life-in-another-world | E | June 28, 2026, 3:33 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 93 | 4096000 | ||
| 380505604 | MatteoArcari | E | June 28, 2026, 3:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 109 | 102400 | ||
| 380512251 | Amrit_Dwivedi | E | June 28, 2026, 4:21 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 109 | 1024000 | ||
| 380510124 | premature | E | June 28, 2026, 4:13 p.m. | OK | C++20 (GCC 13-64) | TESTS | 31 | 109 | 1024000 | ||
| 380541461 | StarSilk | E | June 29, 2026, 1:53 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 46 | 0 | ||
| 380510796 | FuRy_1 | E | June 28, 2026, 4:15 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 46 | 0 | ||
| 380508838 | cn449 | E | June 28, 2026, 4:08 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 46 | 0 | ||
| 380501171 | JahonaliX | E | June 28, 2026, 3:42 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 46 | 0 | ||
| 380522260 | moxoc | E | June 28, 2026, 5:51 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 46 | 5017600 | ||
| 380518341 | dooglius | E | June 28, 2026, 5:06 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 62 | 0 | ||
| 380506781 | unifer | E | June 28, 2026, 4 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 78 | 0 | ||
| 380528621 | abhikr03 | E | June 28, 2026, 7:21 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 78 | 2048000 | ||
| 380513575 | Paul978 | E | June 28, 2026, 4:26 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 78 | 2048000 | ||
| 380510267 | crazygamerbl | E | June 28, 2026, 4:13 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 31 | 78 | 2048000 | ||
| 380503897 | prats2853 | E | June 28, 2026, 3:50 p.m. | OK | Go | TESTS | 31 | 109 | 4710400 | ||
| 380515716 | Roonil03 | E | June 28, 2026, 4:34 p.m. | OK | Go | TESTS | 31 | 125 | 6656000 | ||
| 380510427 | d11maan | E | June 28, 2026, 4:14 p.m. | OK | Go | TESTS | 31 | 468 | 17612800 | ||
| 380512788 | prathipatinitin1234 | E | June 28, 2026, 4:23 p.m. | OK | Java 21 | TESTS | 31 | 343 | 1843200 | ||
| 380510954 | aaryan.issac23 | E | June 28, 2026, 4:16 p.m. | OK | Java 21 | TESTS | 31 | 375 | 409600 | ||
| 380506144 | SiMpL3 | E | June 28, 2026, 3:58 p.m. | OK | Java 21 | TESTS | 31 | 453 | 716800 | ||
| 380512385 | sefirah | E | June 28, 2026, 4:21 p.m. | OK | Java 21 | TESTS | 31 | 468 | 1126400 | ||
| 380505848 | soumya_ranjan17 | E | June 28, 2026, 3:57 p.m. | OK | Java 21 | TESTS | 31 | 515 | 614400 | ||
| 380509097 | Garvit_1218 | E | June 28, 2026, 4:09 p.m. | OK | Java 21 | TESTS | 31 | 562 | 1331200 | ||
| 380513352 | abhinavlanka141 | E | June 28, 2026, 4:25 p.m. | OK | Java 21 | TESTS | 31 | 671 | 1638400 | ||
| 380502538 | LT1 | E | June 28, 2026, 3:46 p.m. | OK | Java 21 | TESTS | 31 | 703 | 921600 | ||
| 380503169 | arpite | E | June 28, 2026, 3:48 p.m. | OK | Java 21 | TESTS | 31 | 734 | 9420800 | ||
| 380505823 | Faria_Samira | E | June 28, 2026, 3:57 p.m. | OK | Java 21 | TESTS | 31 | 843 | 1638400 | ||
| 380500438 | visheshk23 | E | June 28, 2026, 3:39 p.m. | OK | Java 8 | TESTS | 31 | 796 | 0 | ||
| 380507500 | PotatoCoder_ | E | June 28, 2026, 4:03 p.m. | OK | Node.js | TESTS | 31 | 218 | 23142400 | ||
| 380520682 | titia | E | June 28, 2026, 5:32 p.m. | OK | PyPy 3 | TESTS | 31 | 1500 | 21913600 | ||
| 380515593 | shadowthunder | E | June 28, 2026, 4:34 p.m. | OK | PyPy 3-64 | TESTS | 31 | 484 | 16076800 | ||
| 380514616 | mdhasanraza | E | June 28, 2026, 4:30 p.m. | OK | PyPy 3-64 | TESTS | 31 | 640 | 28876800 | ||
| 380516844 | ruancampello | E | June 28, 2026, 4:49 p.m. | OK | PyPy 3-64 | TESTS | 31 | 906 | 8192000 | ||
| 380506782 | Hallowno4 | E | June 28, 2026, 4 p.m. | OK | PyPy 3-64 | TESTS | 31 | 906 | 21196800 | ||
| 380514962 | abhiiify | E | June 28, 2026, 4:32 p.m. | OK | PyPy 3-64 | TESTS | 31 | 1000 | 8908800 | ||
| 380514473 | shashwoto0 | E | June 28, 2026, 4:30 p.m. | OK | PyPy 3-64 | TESTS | 31 | 1156 | 11264000 | ||
| 380514179 | akshat-31415 | E | June 28, 2026, 4:29 p.m. | OK | PyPy 3-64 | TESTS | 31 | 1234 | 22732800 | ||
| 380507733 | kamio-misuzu | E | June 28, 2026, 4:03 p.m. | OK | PyPy 3-64 | TESTS | 31 | 1281 | 10240000 | ||
| 380506723 | u25cs079 | E | June 28, 2026, 4 p.m. | OK | PyPy 3-64 | TESTS | 31 | 1328 | 24268800 | ||
| 380504823 | Z_actuary | E | June 28, 2026, 3:53 p.m. | OK | PyPy 3-64 | TESTS | 31 | 1468 | 14540800 | ||
| 380512515 | aaraverma7 | E | June 28, 2026, 4:22 p.m. | OK | Python 3 | TESTS | 31 | 1203 | 3072000 | ||
| 380513187 | Prestige | E | June 28, 2026, 4:25 p.m. | OK | Python 3 | TESTS | 31 | 1984 | 2764800 | ||
| 380511667 | cvs-650 | E | June 28, 2026, 4:19 p.m. | OK | Rust 2024 | TESTS | 31 | 171 | 0 | ||
| 380517136 | ruanxiaoyu | E | June 28, 2026, 4:52 p.m. | OK | Rust 2024 | TESTS | 31 | 640 | 0 | ||
| 380510096 | darkkcyan | E | June 28, 2026, 4:12 p.m. | OK | Rust 2024 | TESTS | 31 | 1203 | 4915200 | ||
| 380524229 | DanielAnker | E | June 28, 2026, 6:14 p.m. | OK | Rust 2024 | TESTS | 31 | 1265 | 5939200 |
Back to search problems