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 |
---|---|---|---|---|---|---|
1607 | Codeforces Round 753 (Div. 3) | FINISHED | False | 7200 | 101402663 | Nov. 2, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 17117 ) | D | Blue-Red Permutation | PROGRAMMING | greedy math sortings |
B"You are given an array of integers a of length n . The elements of the array can be either different or the same. Each element of the array is colored either blue or red. There are no unpainted elements in the array. One of the two operations described below can be applied to an array in a single step: Situations in which there are no elements of some color at all are also possible. For example, if the whole array is colored blue or red, one of the operations becomes unavailable. Determine whether it is possible to make 0 or more steps such that the resulting array is a permutation of numbers from 1 to n ? In other words, check whether there exists a sequence of steps (possibly empty) such that after applying it, the array a contains in some order all numbers from 1 to n (inclusive), each exactly once. The first line contains an integer t ( 1 <= q t <= q 10^4 ) -- the number of input data sets in the test. The description of each set of input data consists of three lines. The first line contains an integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the length of the original array a . The second line contains n integers a_1 , a_2 , ..., a_n ( -10^9 <= q a_i <= q 10^9 ) -- the array elements themselves. The third line has length n and consists exclusively of the letters 'B' and/or 'R': i th character is 'B' if a_i is colored blue, and is 'R' if colored red. It is guaranteed that the sum of n over all input sets does not exceed 2 cdot 10^5 . Print t lines, each of which contains the answer to the corresponding test case of the input. Print YES as an answer if the corresponding array can be transformed into a permutation, and NO otherwise. You can print the answer in any case (for example, the strings yEs, yes, Yes, and YES will be recognized as a positive answer). In the first test case of the example, the following sequence of "... |
Codeforces Round #753 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
134147940 | Gassa | D | Nov. 2, 2021, 7:18 p.m. | OK | D | TESTS | 8 | 109 | 16793600 | ||
134150335 | Lelouch-ViBritannia | D | Nov. 2, 2021, 7:56 p.m. | OK | GNU C11 | TESTS | 8 | 62 | 6348800 | ||
134165573 | G.Gopi_Krishna | D | Nov. 3, 2021, 2:51 a.m. | OK | GNU C11 | TESTS | 8 | 62 | 6348800 | ||
134172433 | milan_s1 | D | Nov. 3, 2021, 4:23 a.m. | OK | GNU C11 | TESTS | 8 | 405 | 5529600 | ||
134161034 | zjjws | D | Nov. 3, 2021, 12:41 a.m. | OK | GNU C++14 | TESTS | 8 | 15 | 5120000 | ||
134168047 | liang_cheng | D | Nov. 3, 2021, 3:49 a.m. | OK | GNU C++14 | TESTS | 8 | 31 | 7782400 | ||
134135211 | cyg_dragos10 | D | Nov. 2, 2021, 4:56 p.m. | OK | GNU C++14 | TESTS | 7 | 46 | 2867200 | ||
134156073 | 1510 | D | Nov. 2, 2021, 9:47 p.m. | OK | GNU C++14 | TESTS | 8 | 46 | 3379200 | ||
134129717 | k_s_h_i_t_i_j | D | Nov. 2, 2021, 4:33 p.m. | OK | GNU C++14 | TESTS | 7 | 46 | 4096000 | ||
134128080 | praiseTheSun | D | Nov. 2, 2021, 4:29 p.m. | OK | GNU C++14 | TESTS | 7 | 46 | 4096000 | ||
134133317 | _Otabek | D | Nov. 2, 2021, 4:45 p.m. | OK | GNU C++14 | TESTS | 7 | 46 | 4096000 | ||
134158756 | 8ingWings | D | Nov. 2, 2021, 11:17 p.m. | OK | GNU C++14 | TESTS | 8 | 46 | 4096000 | ||
134163044 | griffindor | D | Nov. 3, 2021, 1:45 a.m. | OK | GNU C++14 | TESTS | 8 | 46 | 5734400 | ||
134145766 | ar_rony1 | D | Nov. 2, 2021, 6:48 p.m. | OK | GNU C++14 | TESTS | 8 | 46 | 7065600 | ||
134168771 | Harthik14 | D | Nov. 3, 2021, 4:05 a.m. | OK | GNU C++17 | TESTS | 8 | 46 | 4096000 | ||
134146019 | barnwal11 | D | Nov. 2, 2021, 6:52 p.m. | OK | GNU C++17 | TESTS | 8 | 46 | 4915200 | ||
134169403 | TkFox_wa | D | Nov. 3, 2021, 4:18 a.m. | OK | GNU C++17 | TESTS | 8 | 61 | 2355200 | ||
134162058 | tranhoangson | D | Nov. 3, 2021, 1:13 a.m. | OK | GNU C++17 | TESTS | 8 | 61 | 2867200 | ||
134159723 | Old_man_with_Piggy | D | Nov. 2, 2021, 11:53 p.m. | OK | GNU C++17 | TESTS | 8 | 61 | 3379200 | ||
134168570 | ritikraj6120 | D | Nov. 3, 2021, 4:01 a.m. | OK | GNU C++17 | TESTS | 8 | 61 | 3481600 | ||
134162223 | wenjian | D | Nov. 3, 2021, 1:19 a.m. | OK | GNU C++17 | TESTS | 8 | 61 | 3584000 | ||
134125802 | TypeYippie | D | Nov. 2, 2021, 4:25 p.m. | OK | GNU C++17 | TESTS | 7 | 61 | 3891200 | ||
134126103 | subha_nik | D | Nov. 2, 2021, 4:25 p.m. | OK | GNU C++17 | TESTS | 7 | 61 | 3891200 | ||
134177927 | sanskarnative | D | Nov. 3, 2021, 5:46 a.m. | OK | GNU C++17 | TESTS | 8 | 61 | 4096000 | ||
134133930 | Ankur_Agrawal | D | Nov. 2, 2021, 4:48 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 31 | 4812800 | ||
134158959 | jt.cheng26_orz | D | Nov. 2, 2021, 11:25 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 31 | 6860800 | ||
134135667 | 22h49 | D | Nov. 2, 2021, 5 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 46 | 3481600 | ||
134126405 | Nalrimet | D | Nov. 2, 2021, 4:26 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 46 | 3584000 | ||
134125153 | moyan1082 | D | Nov. 2, 2021, 4:23 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 46 | 4096000 | ||
134156838 | YoRepi7 | D | Nov. 2, 2021, 10:09 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 4096000 | ||
134125119 | tooreys | D | Nov. 2, 2021, 4:23 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 46 | 4096000 | ||
134176650 | small-cai | D | Nov. 3, 2021, 5:29 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 4198400 | ||
134176625 | greatofcuriosity | D | Nov. 3, 2021, 5:29 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 4198400 | ||
134158429 | haot1 | D | Nov. 2, 2021, 11:03 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 4198400 | ||
134125233 | xiongjx | D | Nov. 2, 2021, 4:23 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 15 | 9113600 | ||
134145586 | 3Sa3dI4 | D | Nov. 2, 2021, 6:46 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 3891200 | ||
134143587 | Monazo1997 | D | Nov. 2, 2021, 6:20 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 3891200 | ||
134134460 | generic_placeholder_name | D | Nov. 2, 2021, 4:52 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 31 | 4403200 | ||
134155479 | Teslum | D | Nov. 2, 2021, 9:32 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 6656000 | ||
134175663 | DuyAnhTM | D | Nov. 3, 2021, 5:15 a.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 7065600 | ||
134130827 | pavlovoleg4889 | D | Nov. 2, 2021, 4:34 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 46 | 3481600 | ||
134143581 | assas1 | D | Nov. 2, 2021, 6:20 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 46 | 3481600 | ||
134136493 | sherzodnorboboev | D | Nov. 2, 2021, 5:07 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 46 | 3584000 | ||
134160899 | Yra | D | Nov. 3, 2021, 12:36 a.m. | OK | GNU C++20 (64) | TESTS | 8 | 46 | 3686400 | ||
134165570 | Sandy_coder2001 | D | Nov. 3, 2021, 2:51 a.m. | OK | Java 11 | TESTS | 8 | 233 | 24780800 | ||
134133277 | 3Musketeers | D | Nov. 2, 2021, 4:44 p.m. | OK | Java 11 | TESTS | 7 | 233 | 25600000 | ||
134129406 | nitin23329 | D | Nov. 2, 2021, 4:32 p.m. | OK | Java 11 | TESTS | 7 | 234 | 26828800 | ||
134139935 | yogii_123 | D | Nov. 2, 2021, 5:40 p.m. | OK | Java 11 | TESTS | 8 | 249 | 25395200 | ||
134134425 | bittubittu | D | Nov. 2, 2021, 4:51 p.m. | OK | Java 11 | TESTS | 7 | 249 | 25497600 | ||
134130030 | nitin23329 | D | Nov. 2, 2021, 4:33 p.m. | OK | Java 11 | TESTS | 7 | 249 | 26828800 | ||
134132121 | kushagra219 | D | Nov. 2, 2021, 4:38 p.m. | OK | Java 11 | TESTS | 7 | 249 | 28569600 | ||
134125107 | tushar_patil | D | Nov. 2, 2021, 4:23 p.m. | OK | Java 11 | TESTS | 7 | 249 | 28774400 | ||
134125766 | aayushdhakad | D | Nov. 2, 2021, 4:25 p.m. | OK | Java 11 | TESTS | 7 | 249 | 29798400 | ||
134168379 | shivam29702 | D | Nov. 3, 2021, 3:56 a.m. | OK | Java 11 | TESTS | 8 | 249 | 48537600 | ||
134126961 | ttn.blackstar | D | Nov. 2, 2021, 4:27 p.m. | OK | Java 8 | TESTS | 7 | 155 | 24166400 | ||
134138257 | ChiMasterBing | D | Nov. 2, 2021, 5:23 p.m. | OK | Java 8 | TESTS | 8 | 155 | 24371200 | ||
134165442 | 201502010200 | D | Nov. 3, 2021, 2:48 a.m. | OK | Java 8 | TESTS | 8 | 171 | 25190400 | ||
134173243 | amit_roy | D | Nov. 3, 2021, 4:37 a.m. | OK | Java 8 | TESTS | 8 | 187 | 24166400 | ||
134126648 | yaminote | D | Nov. 2, 2021, 4:27 p.m. | OK | Java 8 | TESTS | 7 | 202 | 23449600 | ||
134144116 | ZiadASadek | D | Nov. 2, 2021, 6:26 p.m. | OK | Java 8 | TESTS | 8 | 202 | 24473600 | ||
134150114 | Sandy_1000 | D | Nov. 2, 2021, 7:52 p.m. | OK | Java 8 | TESTS | 8 | 202 | 97792000 | ||
134129527 | DarthClasher | D | Nov. 2, 2021, 4:32 p.m. | OK | Java 8 | TESTS | 7 | 218 | 24064000 | ||
134135669 | pgthebigshot | D | Nov. 2, 2021, 5 p.m. | OK | Java 8 | TESTS | 7 | 233 | 20070400 | ||
134164266 | shinghalrishabh | D | Nov. 3, 2021, 2:20 a.m. | OK | Java 8 | TESTS | 8 | 233 | 27545600 | ||
134134752 | nopopon | D | Nov. 2, 2021, 4:53 p.m. | OK | Kotlin 1.4 | TESTS | 7 | 296 | 34201600 | ||
134134540 | mishgan | D | Nov. 2, 2021, 4:52 p.m. | OK | Kotlin 1.4 | TESTS | 7 | 311 | 34816000 | ||
134125624 | BruteForcee | D | Nov. 2, 2021, 4:24 p.m. | OK | Kotlin 1.5 | TESTS | 7 | 233 | 25702400 | ||
134143325 | BruteForcee | D | Nov. 2, 2021, 6:16 p.m. | OK | Kotlin 1.5 | TESTS | 8 | 280 | 27238400 | ||
134178878 | noisegain | D | Nov. 3, 2021, 5:58 a.m. | OK | Kotlin 1.5 | TESTS | 8 | 311 | 32972800 | ||
134175463 | Koo_Pung-Kei | D | Nov. 3, 2021, 5:12 a.m. | OK | Kotlin 1.5 | TESTS | 8 | 326 | 37273600 | ||
134161162 | httohu | D | Nov. 3, 2021, 12:46 a.m. | OK | MS C++ 2017 | TESTS | 8 | 156 | 3788800 | ||
134130014 | Agumon | D | Nov. 2, 2021, 4:33 p.m. | OK | MS C++ 2017 | TESTS | 7 | 186 | 7987200 | ||
134130075 | Claude1 | D | Nov. 2, 2021, 4:33 p.m. | OK | MS C++ 2017 | TESTS | 7 | 187 | 4096000 | ||
134152698 | Flyheck | D | Nov. 2, 2021, 8:36 p.m. | OK | MS C++ 2017 | TESTS | 8 | 187 | 6860800 | ||
134174563 | bkifhr8 | D | Nov. 3, 2021, 4:59 a.m. | OK | MS C++ 2017 | TESTS | 8 | 187 | 7987200 | ||
134127736 | hugochien0 | D | Nov. 2, 2021, 4:29 p.m. | OK | MS C++ 2017 | TESTS | 7 | 217 | 4608000 | ||
134155215 | helenmie | D | Nov. 2, 2021, 9:26 p.m. | OK | MS C++ 2017 | TESTS | 8 | 217 | 7065600 | ||
134133208 | charleswang2001 | D | Nov. 2, 2021, 4:44 p.m. | OK | MS C++ 2017 | TESTS | 7 | 234 | 2764800 | ||
134130293 | qhh | D | Nov. 2, 2021, 4:33 p.m. | OK | MS C++ 2017 | TESTS | 7 | 249 | 6451200 | ||
134132288 | garrettseo | D | Nov. 2, 2021, 4:39 p.m. | OK | MS C++ 2017 | TESTS | 7 | 264 | 6246400 | ||
134128251 | reosfire | D | Nov. 2, 2021, 4:30 p.m. | OK | .NET Core C# | TESTS | 7 | 124 | 35430400 | ||
134131650 | Grapeee | D | Nov. 2, 2021, 4:37 p.m. | OK | Node.js | TESTS | 7 | 248 | 27955200 | ||
134162948 | s3vin | D | Nov. 3, 2021, 1:42 a.m. | OK | Perl | TESTS | 8 | 280 | 43008000 | ||
134141832 | snape_here | D | Nov. 2, 2021, 5:59 p.m. | OK | PyPy 2 | TESTS | 8 | 982 | 60211200 | ||
134148012 | hxu10 | D | Nov. 2, 2021, 7:19 p.m. | OK | PyPy 3 | TESTS | 8 | 171 | 35737600 | ||
134173970 | Sujith_ | D | Nov. 3, 2021, 4:49 a.m. | OK | PyPy 3 | TESTS | 8 | 233 | 41574400 | ||
134132614 | armsusman | D | Nov. 2, 2021, 4:41 p.m. | OK | PyPy 3 | TESTS | 7 | 296 | 40345600 | ||
134158614 | lebron87 | D | Nov. 2, 2021, 11:10 p.m. | OK | PyPy 3 | TESTS | 8 | 311 | 34611200 | ||
134125113 | 2019287 | D | Nov. 2, 2021, 4:23 p.m. | OK | PyPy 3 | TESTS | 7 | 311 | 35225600 | ||
134167250 | MILOY | D | Nov. 3, 2021, 3:30 a.m. | OK | PyPy 3 | TESTS | 8 | 311 | 39526400 | ||
134176396 | BingHa | D | Nov. 3, 2021, 5:26 a.m. | OK | PyPy 3 | TESTS | 8 | 327 | 40038400 | ||
134160719 | whatshisbucket | D | Nov. 3, 2021, 12:29 a.m. | OK | PyPy 3 | TESTS | 8 | 452 | 36454400 | ||
134125367 | Silvana_Prevails | D | Nov. 2, 2021, 4:24 p.m. | OK | PyPy 3 | TESTS | 7 | 467 | 31744000 | ||
134130575 | myACEY | D | Nov. 2, 2021, 4:34 p.m. | OK | PyPy 3 | TESTS | 7 | 467 | 34508800 | ||
134139614 | mayank35 | D | Nov. 2, 2021, 5:37 p.m. | OK | PyPy 3-64 | TESTS | 8 | 140 | 56524800 | ||
134143498 | lemiao12 | D | Nov. 2, 2021, 6:19 p.m. | OK | PyPy 3-64 | TESTS | 8 | 171 | 57344000 | ||
134146148 | ps_12 | D | Nov. 2, 2021, 6:53 p.m. | OK | PyPy 3-64 | TESTS | 8 | 265 | 57241600 | ||
134132369 | guineapig | D | Nov. 2, 2021, 4:40 p.m. | OK | PyPy 3-64 | TESTS | 7 | 280 | 53452800 | ||
134164794 | dutt_shouvik | D | Nov. 3, 2021, 2:32 a.m. | OK | PyPy 3-64 | TESTS | 8 | 295 | 189235200 | ||
134133539 | _aadiupadhyay_ | D | Nov. 2, 2021, 4:46 p.m. | OK | PyPy 3-64 | TESTS | 7 | 326 | 64614400 | ||
134132358 | Skillful_Wanderer | D | Nov. 2, 2021, 4:39 p.m. | OK | PyPy 3-64 | TESTS | 7 | 342 | 52531200 | ||
134167277 | akshaykhandelwal | D | Nov. 3, 2021, 3:30 a.m. | OK | PyPy 3-64 | TESTS | 8 | 420 | 52326400 | ||
134160877 | mesaliason | D | Nov. 3, 2021, 12:35 a.m. | OK | PyPy 3-64 | TESTS | 8 | 436 | 46694400 | ||
134157809 | petya47 | D | Nov. 2, 2021, 10:40 p.m. | OK | PyPy 3-64 | TESTS | 8 | 468 | 51712000 | ||
134136794 | OLOGY | D | Nov. 2, 2021, 5:10 p.m. | OK | Python 2 | TESTS | 7 | 312 | 17920000 | ||
134137031 | OLOGY | D | Nov. 2, 2021, 5:12 p.m. | OK | Python 2 | TESTS | 7 | 343 | 17817600 | ||
134134005 | OLOGY | D | Nov. 2, 2021, 4:49 p.m. | OK | Python 2 | TESTS | 7 | 389 | 22323200 | ||
134172687 | MilitiaKing | D | Nov. 3, 2021, 4:28 a.m. | OK | Python 3 | TESTS | 8 | 186 | 18432000 | ||
134125551 | ari100tel | D | Nov. 2, 2021, 4:24 p.m. | OK | Python 3 | TESTS | 7 | 217 | 17817600 | ||
134137608 | emil_ask | D | Nov. 2, 2021, 5:17 p.m. | OK | Python 3 | TESTS | 7 | 249 | 17817600 | ||
134148877 | SwapT087 | D | Nov. 2, 2021, 7:33 p.m. | OK | Python 3 | TESTS | 8 | 249 | 18329600 | ||
134144891 | osmosian-460 | D | Nov. 2, 2021, 6:37 p.m. | OK | Python 3 | TESTS | 8 | 264 | 17817600 | ||
134143013 | luciferstern | D | Nov. 2, 2021, 6:12 p.m. | OK | Python 3 | TESTS | 8 | 264 | 18329600 | ||
134140038 | samhappy9 | D | Nov. 2, 2021, 5:41 p.m. | OK | Python 3 | TESTS | 8 | 264 | 18944000 | ||
134173420 | mrobiul | D | Nov. 3, 2021, 4:39 a.m. | OK | Python 3 | TESTS | 8 | 265 | 17817600 | ||
134173271 | srigowrimv | D | Nov. 3, 2021, 4:37 a.m. | OK | Python 3 | TESTS | 8 | 265 | 17817600 | ||
134133727 | akshaywairagade2 | D | Nov. 2, 2021, 4:47 p.m. | OK | Python 3 | TESTS | 7 | 265 | 17817600 | ||
134165114 | Spheniscine | D | Nov. 3, 2021, 2:39 a.m. | OK | Rust | TESTS | 8 | 46 | 2969600 | ||
134135716 | 725973 | D | Nov. 2, 2021, 5 p.m. | OK | Rust | TESTS | 7 | 109 | 8089600 |
Back to search problems