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 |
---|---|---|---|---|---|---|
1706 | Codeforces Round 809 (Div. 2) | FINISHED | False | 7200 | 79111463 | July 18, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 16751 ) | B | Making Towers | PROGRAMMING | dp greedy math |
B'You have a sequence of n colored blocks. The color of the i -th block is c_i , an integer between 1 and n . You will place the blocks down in sequence on an infinite coordinate grid in the following way. A tower is formed by s blocks such that they are placed at positions (x, y), (x, y + 1), ldots, (x, y + s - 1) for some position (x, y) and integer s . The size of the tower is s , the number of blocks in it. A tower of color r is a tower such that all blocks in it have the color r . For each color r from 1 to n , solve the following problem independently: The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 10^5 ). The second line of each test case contains n integers c_1, c_2, ldots, c_n ( 1 <= c_i <= n ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output n integers. The r -th of them should be the maximum size of an tower of color r you can form by following the given rules. If you cannot form any tower of color r , the r -th integer should be 0 . In the first test case, one of the possible ways to form a tower of color 1 and size 3 is: The blocks at positions (0, 0) , (0, 1) , and (0, 2) all have color 1 , forming an tower of size 3 . In the second test case, note that the following placement is not valid, since you are not allowed to place block 6 under block 5 : It can be shown that it is impossible to form a tower of color 4 and size 3 . '... |
Codeforces Round #809 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
164803868 | mban259 | B | July 18, 2022, 6:09 p.m. | OK | C# 10 | TESTS | 19 | 155 | 17612800 | ||
164804912 | ruban | B | July 18, 2022, 6:18 p.m. | OK | Delphi | TESTS | 19 | 171 | 157491200 | ||
164841805 | SP2003 | B | July 19, 2022, 3:41 a.m. | OK | GNU C11 | TESTS | 19 | 810 | 1638400 | ||
164792879 | _harsha_ | B | July 18, 2022, 4:32 p.m. | OK | GNU C11 | TESTS | 19 | 858 | 4198400 | ||
164811742 | Lis_Aleksandr | B | July 18, 2022, 7:31 p.m. | OK | GNU C11 | TESTS | 19 | 982 | 819200 | ||
164811849 | Lis_Aleksandr | B | July 18, 2022, 7:32 p.m. | OK | GNU C11 | TESTS | 19 | 997 | 819200 | ||
164811470 | Lis_Aleksandr | B | July 18, 2022, 7:28 p.m. | OK | GNU C11 | TESTS | 19 | 998 | 819200 | ||
164821032 | zzlzzlzzl | B | July 18, 2022, 9:38 p.m. | OK | GNU C++14 | TESTS | 19 | 46 | 5324800 | ||
164825459 | zzlzzlzzl | B | July 18, 2022, 11:16 p.m. | OK | GNU C++14 | TESTS | 19 | 46 | 5324800 | ||
164838922 | CodeRookie666 | B | July 19, 2022, 3:03 a.m. | OK | GNU C++14 | TESTS | 19 | 62 | 819200 | ||
164850244 | Suraj_20 | B | July 19, 2022, 5:44 a.m. | OK | GNU C++14 | TESTS | 19 | 62 | 921600 | ||
164810925 | wakaranai | B | July 18, 2022, 7:22 p.m. | OK | GNU C++14 | TESTS | 19 | 62 | 921600 | ||
164847177 | DestroyCopyright | B | July 19, 2022, 5:03 a.m. | OK | GNU C++14 | TESTS | 19 | 62 | 1638400 | ||
164833899 | glotm | B | July 19, 2022, 1:59 a.m. | OK | GNU C++14 | TESTS | 19 | 62 | 1638400 | ||
164825168 | SpadeA261 | B | July 18, 2022, 11:08 p.m. | OK | GNU C++14 | TESTS | 19 | 62 | 2457600 | ||
164833080 | sunjiazheng | B | July 19, 2022, 1:48 a.m. | OK | GNU C++14 | TESTS | 19 | 62 | 3174400 | ||
164812475 | atharva_0307 | B | July 18, 2022, 7:38 p.m. | OK | GNU C++14 | TESTS | 19 | 62 | 3379200 | ||
164825386 | Archduke | B | July 18, 2022, 11:14 p.m. | OK | GNU C++17 | TESTS | 19 | 62 | 921600 | ||
164819230 | manku0818 | B | July 18, 2022, 9:06 p.m. | OK | GNU C++17 | TESTS | 19 | 62 | 1024000 | ||
164816316 | mini_militia_105 | B | July 18, 2022, 8:24 p.m. | OK | GNU C++17 | TESTS | 19 | 62 | 1228800 | ||
164800905 | kalpturer | B | July 18, 2022, 5:44 p.m. | OK | GNU C++17 | TESTS | 19 | 62 | 1228800 | ||
164791407 | anomander_rake7 | B | July 18, 2022, 4:29 p.m. | OK | GNU C++17 | TESTS | 19 | 62 | 1331200 | ||
164847630 | hackster_1 | B | July 19, 2022, 5:09 a.m. | OK | GNU C++17 | TESTS | 19 | 62 | 1331200 | ||
164801450 | ayus1410 | B | July 18, 2022, 5:49 p.m. | OK | GNU C++17 | TESTS | 19 | 62 | 1740800 | ||
164840562 | ZWF_102103135 | B | July 19, 2022, 3:24 a.m. | OK | GNU C++17 | TESTS | 19 | 62 | 3379200 | ||
164821528 | Sparnke | B | July 18, 2022, 9:48 p.m. | OK | GNU C++17 | TESTS | 19 | 62 | 3379200 | ||
164791383 | C4rlosVz | B | July 18, 2022, 4:29 p.m. | OK | GNU C++17 | TESTS | 19 | 62 | 24064000 | ||
164834256 | RetsaZC19 | B | July 19, 2022, 2:04 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 46 | 819200 | ||
164848089 | MisbahUddinTareQ | B | July 19, 2022, 5:16 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 46 | 1638400 | ||
164832968 | zszz3 | B | July 19, 2022, 1:47 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 46 | 4812800 | ||
164830069 | Eter.nal | B | July 19, 2022, 1:05 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 46 | 4812800 | ||
164813987 | hocusPocus_abrakadabra | B | July 18, 2022, 7:56 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 61 | 2457600 | ||
164808674 | startrek4 | B | July 18, 2022, 6:57 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 61 | 2457600 | ||
164804374 | awakenedbeast | B | July 18, 2022, 6:13 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 61 | 4608000 | ||
164843856 | nit_ay03 | B | July 19, 2022, 4:10 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 61 | 5017600 | ||
164806322 | NK_ | B | July 18, 2022, 6:32 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 62 | 819200 | ||
164798955 | BucketPotato | B | July 18, 2022, 5:31 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 62 | 819200 | ||
164801197 | p.ferrari | B | July 18, 2022, 5:47 p.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 409600 | ||
164805158 | LLGM | B | July 18, 2022, 6:21 p.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 819200 | ||
164848323 | Rudraksh | B | July 19, 2022, 5:18 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 819200 | ||
164842855 | Osama.Rafat100 | B | July 19, 2022, 3:55 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 819200 | ||
164833630 | stricks | B | July 19, 2022, 1:55 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 819200 | ||
164829359 | Simple_QAQ | B | July 19, 2022, 12:52 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 819200 | ||
164814704 | AnotherTwinkle | B | July 18, 2022, 8:04 p.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 819200 | ||
164838589 | A_king | B | July 19, 2022, 2:58 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 1228800 | ||
164840492 | EotUL8d7 | B | July 19, 2022, 3:23 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 1228800 | ||
164847173 | s_jaskaran_s | B | July 19, 2022, 5:03 a.m. | OK | GNU C++20 (64) | TESTS | 19 | 46 | 1228800 | ||
164816306 | shiro | B | July 18, 2022, 8:24 p.m. | OK | Go | TESTS | 19 | 140 | 3584000 | ||
164822562 | glebsamsonov | B | July 18, 2022, 10:07 p.m. | OK | Go | TESTS | 19 | 748 | 11980800 | ||
164848678 | KarMa_ | B | July 19, 2022, 5:23 a.m. | OK | Java 11 | TESTS | 19 | 202 | 0 | ||
164850352 | Heni_2021 | B | July 19, 2022, 5:45 a.m. | OK | Java 11 | TESTS | 19 | 234 | 0 | ||
164840311 | KarMa_ | B | July 19, 2022, 3:20 a.m. | OK | Java 11 | TESTS | 19 | 234 | 0 | ||
164791418 | CheeseBurber | B | July 18, 2022, 4:29 p.m. | OK | Java 11 | TESTS | 19 | 248 | 0 | ||
164848818 | __Serendipity | B | July 19, 2022, 5:25 a.m. | OK | Java 11 | TESTS | 19 | 249 | 0 | ||
164805449 | amanpatel23 | B | July 18, 2022, 6:23 p.m. | OK | Java 11 | TESTS | 19 | 264 | 0 | ||
164813234 | Yermanov | B | July 18, 2022, 7:47 p.m. | OK | Java 11 | TESTS | 19 | 280 | 307200 | ||
164804470 | Hsharma | B | July 18, 2022, 6:14 p.m. | OK | Java 11 | TESTS | 19 | 280 | 82227200 | ||
164842100 | vijender_8601 | B | July 19, 2022, 3:45 a.m. | OK | Java 11 | TESTS | 19 | 296 | 3174400 | ||
164801631 | mcrash12 | B | July 18, 2022, 5:50 p.m. | OK | Java 11 | TESTS | 19 | 311 | 0 | ||
164830918 | pili | B | July 19, 2022, 1:18 a.m. | OK | Java 17 | TESTS | 19 | 233 | 512000 | ||
164818688 | sahilrathore03 | B | July 18, 2022, 8:58 p.m. | OK | Java 17 | TESTS | 19 | 421 | 18124800 | ||
164803935 | Forbidden_Bruteforce | B | July 18, 2022, 6:10 p.m. | OK | Java 17 | TESTS | 19 | 607 | 614400 | ||
164812444 | Ali04 | B | July 18, 2022, 7:38 p.m. | OK | Java 17 | TESTS | 19 | 967 | 15769600 | ||
164851157 | zgw | B | July 19, 2022, 5:55 a.m. | OK | Java 8 | TESTS | 19 | 156 | 0 | ||
164848688 | Do_not_Look_Back | B | July 19, 2022, 5:23 a.m. | OK | Java 8 | TESTS | 19 | 171 | 0 | ||
164797492 | Mohamed308 | B | July 18, 2022, 5:25 p.m. | OK | Java 8 | TESTS | 19 | 202 | 0 | ||
164791243 | Youssef1Shawky | B | July 18, 2022, 4:29 p.m. | OK | Java 8 | TESTS | 19 | 202 | 1536000 | ||
164792456 | dasaripranayteja | B | July 18, 2022, 4:31 p.m. | OK | Java 8 | TESTS | 19 | 202 | 1945600 | ||
164839673 | Zahid_Hasan_Sahin | B | July 19, 2022, 3:12 a.m. | OK | Java 8 | TESTS | 19 | 202 | 5632000 | ||
164824146 | Sussykin | B | July 18, 2022, 10:43 p.m. | OK | Java 8 | TESTS | 19 | 248 | 10342400 | ||
164801829 | Mohamed_A7med | B | July 18, 2022, 5:52 p.m. | OK | Java 8 | TESTS | 19 | 249 | 7475200 | ||
164811917 | Swapniltri | B | July 18, 2022, 7:33 p.m. | OK | Java 8 | TESTS | 19 | 249 | 13312000 | ||
164793555 | wyxfwxh250821 | B | July 18, 2022, 4:33 p.m. | OK | Java 8 | TESTS | 19 | 280 | 15769600 | ||
164815372 | PavelChadnov | B | July 18, 2022, 8:12 p.m. | OK | Kotlin 1.4 | TESTS | 19 | 296 | 12595200 | ||
164788588 | Ariful3671 | B | July 18, 2022, 4:23 p.m. | OK | Kotlin 1.6 | TESTS | 19 | 514 | 6246400 | ||
164837068 | daozhang | B | July 19, 2022, 2:39 a.m. | OK | MS C++ 2017 | TESTS | 19 | 249 | 1638400 | ||
164793905 | DRUN9 | B | July 18, 2022, 4:34 p.m. | OK | MS C++ 2017 | TESTS | 19 | 280 | 1638400 | ||
164793218 | danthanhhuynhpham | B | July 18, 2022, 4:33 p.m. | OK | MS C++ 2017 | TESTS | 19 | 295 | 1228800 | ||
164833829 | M_zhi | B | July 19, 2022, 1:58 a.m. | OK | MS C++ 2017 | TESTS | 19 | 405 | 819200 | ||
164788225 | JustOnlyOne | B | July 18, 2022, 4:22 p.m. | OK | MS C++ 2017 | TESTS | 19 | 451 | 819200 | ||
164834412 | XYShaoKang | B | July 19, 2022, 2:06 a.m. | OK | Node.js | TESTS | 19 | 327 | 36864000 | ||
164788226 | asumo_king | B | July 18, 2022, 4:22 p.m. | OK | PyPy 3 | TESTS | 19 | 607 | 31744000 | ||
164824936 | Believer_Ayush | B | July 18, 2022, 11:02 p.m. | OK | PyPy 3 | TESTS | 19 | 639 | 24268800 | ||
164827711 | raushnn | B | July 19, 2022, 12:17 a.m. | OK | PyPy 3 | TESTS | 19 | 685 | 20992000 | ||
164803815 | polarstern | B | July 18, 2022, 6:09 p.m. | OK | PyPy 3-64 | TESTS | 19 | 202 | 21811200 | ||
164844736 | only_noob | B | July 19, 2022, 4:24 a.m. | OK | PyPy 3-64 | TESTS | 19 | 217 | 26009600 | ||
164807696 | mayank35 | B | July 18, 2022, 6:46 p.m. | OK | PyPy 3-64 | TESTS | 19 | 218 | 31948800 | ||
164817224 | iron_nicko | B | July 18, 2022, 8:36 p.m. | OK | PyPy 3-64 | TESTS | 19 | 218 | 40243200 | ||
164807024 | Leocosmos | B | July 18, 2022, 6:39 p.m. | OK | PyPy 3-64 | TESTS | 19 | 249 | 40755200 | ||
164788748 | tgr_code | B | July 18, 2022, 4:23 p.m. | OK | PyPy 3-64 | TESTS | 19 | 296 | 23961600 | ||
164837378 | 3juhwan | B | July 19, 2022, 2:43 a.m. | OK | PyPy 3-64 | TESTS | 19 | 311 | 33075200 | ||
164788986 | Leocosmos | B | July 18, 2022, 4:24 p.m. | OK | PyPy 3-64 | TESTS | 19 | 311 | 40448000 | ||
164800513 | Aksnov | B | July 18, 2022, 5:42 p.m. | OK | PyPy 3-64 | TESTS | 19 | 312 | 32563200 | ||
164838165 | 3juhwan | B | July 19, 2022, 2:53 a.m. | OK | PyPy 3-64 | TESTS | 19 | 327 | 27545600 | ||
164831741 | yylele | B | July 19, 2022, 1:30 a.m. | OK | Python 3 | TESTS | 19 | 327 | 6963200 | ||
164797689 | Player001 | B | July 18, 2022, 5:25 p.m. | OK | Python 3 | TESTS | 19 | 342 | 11673600 | ||
164844205 | lakshayne | B | July 19, 2022, 4:15 a.m. | OK | Python 3 | TESTS | 19 | 421 | 18636800 | ||
164843557 | odinluca | B | July 19, 2022, 4:05 a.m. | OK | Python 3 | TESTS | 19 | 436 | 17510400 | ||
164831820 | yylele | B | July 19, 2022, 1:31 a.m. | OK | Python 3 | TESTS | 19 | 451 | 7372800 | ||
164798842 | poonam | B | July 18, 2022, 5:30 p.m. | OK | Python 3 | TESTS | 19 | 483 | 17305600 | ||
164840971 | AndrescuIII | B | July 19, 2022, 3:29 a.m. | OK | Python 3 | TESTS | 19 | 529 | 11571200 | ||
164816864 | jb.l | B | July 18, 2022, 8:31 p.m. | OK | Python 3 | TESTS | 19 | 530 | 10444800 | ||
164801432 | eugalt | B | July 18, 2022, 5:48 p.m. | OK | Python 3 | TESTS | 19 | 530 | 15052800 | ||
164815828 | hany.elnokaly | B | July 18, 2022, 8:18 p.m. | OK | Python 3 | TESTS | 19 | 561 | 10547200 | ||
164789143 | NetravatPendsey | B | July 18, 2022, 4:24 p.m. | OK | Rust 2021 | TESTS | 19 | 77 | 4198400 | ||
164808033 | jwangbelvedere | B | July 18, 2022, 6:50 p.m. | OK | Scala | TESTS | 19 | 608 | 5120000 |
Back to search problems