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 |
---|---|---|---|---|---|---|
1759 | Codeforces Round 834 (Div. 3) | FINISHED | False | 8100 | 68484263 | Nov. 18, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 22473 ) | B | Lost Permutation | PROGRAMMING | math |
B'A sequence of n numbers is called a permutation if it contains all integers from 1 to n exactly once. For example, the sequences [ 3, 1, 4, 2 ], [ 1 ] and [ 2,1 ] are permutations, but [ 1,2,1 ], [ 0,1 ] and [ 1,3,4 ] -- are not. Polycarp lost his favorite permutation and found only some of its elements -- the numbers b_1, b_2, ... b_m . He is sure that the sum of the lost elements equals s . Determine whether one or more numbers can be appended to the given sequence b_1, b_2, ... b_m such that the sum of the added numbers equals s , and the resulting new array is a permutation? The first line of input contains a single integer t ( 1 <= t <= 100 ) --the number of test cases. Then the descriptions of the test cases follow. The first line of each test set contains two integers m and s ( 1 <= m <= 50 , 1 <= s <= 1000 ) ---the number of found elements and the sum of forgotten numbers. The second line of each test set contains m different integers b_1, b_2 ... b_m ( 1 <= b_i <= 50 ) -- the elements Polycarp managed to find. Print t lines, each of which is the answer to the corresponding test set. Print as the answer YES if you can append several elements to the array b , that their sum equals s and the result will be a permutation. Output NO otherwise. You can output the answer in any case (for example, yEs, yes, Yes and YES will be recognized as positive answer). In the test case of the example, m=3, s=13, b=[3,1,4] . You can append to b the numbers 6,2,5 , the sum of which is 6+2+5=13 . Note that the final array will become [3,1,4,6,2,5] , which is a permutation. In the second test case of the example, m=1, s=1, b=[1] . You cannot append one or more numbers to [1] such that their sum equals 1 and the result is a permutation. In the third test case of the example, m=3, '... |
109254 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
181532030 | Abu_Bakar_Siddik | B | Nov. 18, 2022, 7:09 p.m. | OK | C# 10 | TESTS | 12 | 46 | 2457600 | ||
181555060 | chrisfcoder | B | Nov. 19, 2022, 3:28 a.m. | OK | C# 10 | TESTS | 15 | 109 | 204800 | ||
181549176 | zixiang | B | Nov. 19, 2022, 1:22 a.m. | OK | Clang++17 Diagnostics | TESTS | 15 | 31 | 0 | ||
181557607 | sSoftd | B | Nov. 19, 2022, 4:13 a.m. | OK | Clang++17 Diagnostics | TESTS | 15 | 46 | 0 | ||
181537514 | NikitaSergeev | B | Nov. 18, 2022, 8:13 p.m. | OK | Clang++17 Diagnostics | TESTS | 15 | 46 | 4198400 | ||
181555697 | GianKuhz | B | Nov. 19, 2022, 3:40 a.m. | OK | Clang++20 Diagnostics | TESTS | 15 | 31 | 0 | ||
181547344 | EDCTY | B | Nov. 19, 2022, 12:20 a.m. | OK | Clang++20 Diagnostics | TESTS | 15 | 46 | 4198400 | ||
181552213 | oldprg | B | Nov. 19, 2022, 2:33 a.m. | OK | GNU C11 | TESTS | 15 | 15 | 0 | ||
181552261 | oldprg | B | Nov. 19, 2022, 2:34 a.m. | OK | GNU C11 | TESTS | 15 | 15 | 0 | ||
181527420 | Sifat_RU | B | Nov. 18, 2022, 6:18 p.m. | OK | GNU C11 | TESTS | 12 | 15 | 0 | ||
181552880 | oldprg | B | Nov. 19, 2022, 2:46 a.m. | OK | GNU C11 | TESTS | 15 | 15 | 0 | ||
181559164 | AadithyaK18 | B | Nov. 19, 2022, 4:39 a.m. | OK | GNU C11 | TESTS | 15 | 15 | 0 | ||
181563991 | Miraemon | B | Nov. 19, 2022, 5:44 a.m. | OK | GNU C11 | TESTS | 15 | 15 | 0 | ||
181535458 | nestor_makhno | B | Nov. 18, 2022, 7:47 p.m. | OK | GNU C11 | TESTS | 12 | 15 | 0 | ||
181537603 | ragged_eye | B | Nov. 18, 2022, 8:14 p.m. | OK | GNU C11 | TESTS | 15 | 15 | 0 | ||
181541481 | skjimoin | B | Nov. 18, 2022, 9:21 p.m. | OK | GNU C11 | TESTS | 15 | 15 | 0 | ||
181545133 | Mushfiqur_ | B | Nov. 18, 2022, 10:56 p.m. | OK | GNU C11 | TESTS | 15 | 15 | 0 | ||
181548580 | Cycyes | B | Nov. 19, 2022, 1:04 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
181530313 | AleksaMaster | B | Nov. 18, 2022, 6:49 p.m. | OK | GNU C++14 | TESTS | 12 | 0 | 0 | ||
181529252 | maksudul | B | Nov. 18, 2022, 6:37 p.m. | OK | GNU C++14 | TESTS | 12 | 0 | 0 | ||
181524111 | T--o_o--T | B | Nov. 18, 2022, 5:48 p.m. | OK | GNU C++14 | TESTS | 12 | 0 | 0 | ||
181523915 | covid_coder | B | Nov. 18, 2022, 5:46 p.m. | OK | GNU C++14 | TESTS | 12 | 0 | 0 | ||
181522906 | 1eonscount | B | Nov. 18, 2022, 5:37 p.m. | OK | GNU C++14 | TESTS | 5 | 0 | 0 | ||
181522482 | moaiad.abdulsalam | B | Nov. 18, 2022, 5:34 p.m. | OK | GNU C++14 | TESTS | 5 | 0 | 0 | ||
181519821 | Pratham_patil724 | B | Nov. 18, 2022, 5:16 p.m. | OK | GNU C++14 | TESTS | 5 | 0 | 0 | ||
181558985 | shattershade | B | Nov. 19, 2022, 4:35 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
181553201 | watermelon_contest | B | Nov. 19, 2022, 2:52 a.m. | OK | GNU C++14 | TESTS | 15 | 0 | 0 | ||
181534496 | Chanpreet | B | Nov. 18, 2022, 7:35 p.m. | OK | GNU C++17 | TESTS | 12 | 0 | 0 | ||
181538799 | s_k2003 | B | Nov. 18, 2022, 8:32 p.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
181546765 | goodDaytoDie | B | Nov. 18, 2022, 11:58 p.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
181547458 | yanshi | B | Nov. 19, 2022, 12:25 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
181553147 | Symon434 | B | Nov. 19, 2022, 2:51 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
181556937 | shany212 | B | Nov. 19, 2022, 4:01 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
181560857 | araysh | B | Nov. 19, 2022, 5:04 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
181564792 | Asunataisiki | B | Nov. 19, 2022, 5:53 a.m. | OK | GNU C++17 | TESTS | 15 | 0 | 0 | ||
181530475 | arvind26 | B | Nov. 18, 2022, 6:51 p.m. | OK | GNU C++17 | TESTS | 12 | 0 | 0 | ||
181530371 | Kiri_to | B | Nov. 18, 2022, 6:50 p.m. | OK | GNU C++17 | TESTS | 12 | 0 | 0 | ||
181554441 | YaliCai | B | Nov. 19, 2022, 3:18 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
181560588 | fytftyf | B | Nov. 19, 2022, 4:59 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
181558256 | mrarman | B | Nov. 19, 2022, 4:24 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
181557899 | jisanahmed10667 | B | Nov. 19, 2022, 4:17 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
181550012 | Kellyz | B | Nov. 19, 2022, 1:44 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
181547693 | Batata707 | B | Nov. 19, 2022, 12:35 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
181546228 | anuanuclone | B | Nov. 18, 2022, 11:36 p.m. | OK | GNU C++17 (64) | TESTS | 15 | 0 | 0 | ||
181536749 | Ajoad_Islam_Nishat | B | Nov. 18, 2022, 8:02 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 0 | 0 | ||
181536152 | samitmaharjan.g | B | Nov. 18, 2022, 7:55 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 0 | 0 | ||
181529150 | BetoSCL | B | Nov. 18, 2022, 6:36 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 0 | 0 | ||
181559316 | arpit_275 | B | Nov. 19, 2022, 4:41 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181559392 | yuhang123 | B | Nov. 19, 2022, 4:42 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181561058 | shubhanshu082 | B | Nov. 19, 2022, 5:06 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181561548 | walisa | B | Nov. 19, 2022, 5:14 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181561579 | LINbo123 | B | Nov. 19, 2022, 5:14 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181561701 | hustlerr | B | Nov. 19, 2022, 5:16 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181561920 | stellarhuman09 | B | Nov. 19, 2022, 5:18 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181561957 | Bulka423 | B | Nov. 19, 2022, 5:19 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181562944 | Sabbir1807070 | B | Nov. 19, 2022, 5:31 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181564462 | Ashokdon | B | Nov. 19, 2022, 5:50 a.m. | OK | GNU C++20 (64) | TESTS | 15 | 0 | 0 | ||
181528188 | sduMamutbekov | B | Nov. 18, 2022, 6:26 p.m. | OK | Java 11 | TESTS | 12 | 155 | 0 | ||
181523282 | vijender_8601 | B | Nov. 18, 2022, 5:40 p.m. | OK | Java 11 | TESTS | 5 | 155 | 0 | ||
181522137 | princeayush04 | B | Nov. 18, 2022, 5:31 p.m. | OK | Java 11 | TESTS | 5 | 155 | 0 | ||
181521278 | manasrai1234567 | B | Nov. 18, 2022, 5:25 p.m. | OK | Java 11 | TESTS | 5 | 156 | 0 | ||
181528587 | singhharman | B | Nov. 18, 2022, 6:30 p.m. | OK | Java 11 | TESTS | 12 | 170 | 0 | ||
181515286 | __Serendipity | B | Nov. 18, 2022, 4:53 p.m. | OK | Java 11 | TESTS | 5 | 170 | 0 | ||
181563083 | deepakanto | B | Nov. 19, 2022, 5:33 a.m. | OK | Java 11 | TESTS | 15 | 171 | 0 | ||
181538905 | rajneesh.osho | B | Nov. 18, 2022, 8:34 p.m. | OK | Java 11 | TESTS | 15 | 171 | 0 | ||
181518458 | AyushS_cg170 | B | Nov. 18, 2022, 5:09 p.m. | OK | Java 11 | TESTS | 5 | 171 | 0 | ||
181515459 | ritik0602 | B | Nov. 18, 2022, 4:54 p.m. | OK | Java 11 | TESTS | 5 | 171 | 0 | ||
181510141 | amit_kumar_90 | B | Nov. 18, 2022, 4:42 p.m. | OK | Java 17 | TESTS | 5 | 171 | 0 | ||
181528754 | __Aniket__ | B | Nov. 18, 2022, 6:32 p.m. | OK | Java 17 | TESTS | 12 | 171 | 307200 | ||
181523294 | chshivm007 | B | Nov. 18, 2022, 5:40 p.m. | OK | Java 17 | TESTS | 5 | 187 | 512000 | ||
181514856 | adilkhanbolotbekov | B | Nov. 18, 2022, 4:52 p.m. | OK | Java 17 | TESTS | 5 | 202 | 0 | ||
181559352 | jashwanth_2003 | B | Nov. 19, 2022, 4:42 a.m. | OK | Java 17 | TESTS | 15 | 202 | 409600 | ||
181524561 | girdhar | B | Nov. 18, 2022, 5:51 p.m. | OK | Java 17 | TESTS | 12 | 202 | 512000 | ||
181511901 | simoneponginibbio | B | Nov. 18, 2022, 4:45 p.m. | OK | Java 17 | TESTS | 5 | 202 | 716800 | ||
181510977 | Chirag_agrawal | B | Nov. 18, 2022, 4:43 p.m. | OK | Java 17 | TESTS | 5 | 218 | 0 | ||
181539974 | Vertigo_507 | B | Nov. 18, 2022, 8:53 p.m. | OK | Java 17 | TESTS | 15 | 234 | 614400 | ||
181557188 | code_my_way123 | B | Nov. 19, 2022, 4:06 a.m. | OK | Java 17 | TESTS | 15 | 249 | 409600 | ||
181516009 | Imran435 | B | Nov. 18, 2022, 4:56 p.m. | OK | Java 8 | TESTS | 5 | 77 | 0 | ||
181560585 | leonlian | B | Nov. 19, 2022, 4:59 a.m. | OK | Java 8 | TESTS | 15 | 93 | 0 | ||
181556790 | TangM | B | Nov. 19, 2022, 3:59 a.m. | OK | Java 8 | TESTS | 15 | 93 | 0 | ||
181547781 | Kisuke | B | Nov. 19, 2022, 12:38 a.m. | OK | Java 8 | TESTS | 15 | 93 | 0 | ||
181526214 | P1011 | B | Nov. 18, 2022, 6:06 p.m. | OK | Java 8 | TESTS | 12 | 93 | 0 | ||
181524898 | Zicode | B | Nov. 18, 2022, 5:54 p.m. | OK | Java 8 | TESTS | 12 | 93 | 0 | ||
181520281 | ankit_0207 | B | Nov. 18, 2022, 5:19 p.m. | OK | Java 8 | TESTS | 5 | 93 | 0 | ||
181510277 | shreya.roy.121999 | B | Nov. 18, 2022, 4:42 p.m. | OK | Java 8 | TESTS | 5 | 108 | 0 | ||
181525258 | toufique_husein | B | Nov. 18, 2022, 5:57 p.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
181524122 | Juhaied_nabid | B | Nov. 18, 2022, 5:48 p.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
181547494 | in_the_Air | B | Nov. 19, 2022, 12:27 a.m. | OK | Kotlin 1.6 | TESTS | 15 | 233 | 921600 | ||
181556863 | DimaKhovrov | B | Nov. 19, 2022, 4 a.m. | OK | MS C++ 2017 | TESTS | 15 | 15 | 0 | ||
181548911 | slkrus | B | Nov. 19, 2022, 1:14 a.m. | OK | MS C++ 2017 | TESTS | 15 | 15 | 0 | ||
181516922 | Ahrar_Hussain | B | Nov. 18, 2022, 5:01 p.m. | OK | MS C++ 2017 | TESTS | 5 | 15 | 0 | ||
181511660 | ishybee | B | Nov. 18, 2022, 4:45 p.m. | OK | MS C++ 2017 | TESTS | 5 | 15 | 0 | ||
181511463 | naman_21verma | B | Nov. 18, 2022, 4:44 p.m. | OK | MS C++ 2017 | TESTS | 5 | 15 | 0 | ||
181514598 | RED--1 | B | Nov. 18, 2022, 4:49 p.m. | OK | PyPy 3 | TESTS | 5 | 77 | 1433600 | ||
181536863 | Lammert0907 | B | Nov. 18, 2022, 8:04 p.m. | OK | PyPy 3 | TESTS | 12 | 77 | 1536000 | ||
181536668 | sohilkhanduja | B | Nov. 18, 2022, 8:02 p.m. | OK | PyPy 3 | TESTS | 12 | 77 | 1536000 | ||
181524425 | u1602016 | B | Nov. 18, 2022, 5:50 p.m. | OK | PyPy 3 | TESTS | 12 | 77 | 1536000 | ||
181512654 | hjk63 | B | Nov. 18, 2022, 4:47 p.m. | OK | PyPy 3 | TESTS | 5 | 93 | 1945600 | ||
181523781 | sw_enthusiast | B | Nov. 18, 2022, 5:45 p.m. | OK | PyPy 3 | TESTS | 12 | 109 | 67276800 | ||
181546097 | zmonster8 | B | Nov. 18, 2022, 11:31 p.m. | OK | PyPy 3 | TESTS | 15 | 140 | 1433600 | ||
181544949 | vishnesh | B | Nov. 18, 2022, 10:49 p.m. | OK | PyPy 3 | TESTS | 15 | 155 | 1536000 | ||
181542583 | TODAISY | B | Nov. 18, 2022, 9:46 p.m. | OK | PyPy 3 | TESTS | 15 | 436 | 6656000 | ||
181554484 | Ninym_ | B | Nov. 19, 2022, 3:19 a.m. | OK | PyPy 3-64 | TESTS | 15 | 61 | 1536000 | ||
181520503 | McPqndq | B | Nov. 18, 2022, 5:20 p.m. | OK | PyPy 3-64 | TESTS | 5 | 61 | 1740800 | ||
181552459 | JamesHu | B | Nov. 19, 2022, 2:38 a.m. | OK | PyPy 3-64 | TESTS | 15 | 61 | 1945600 | ||
181563841 | brimstone | B | Nov. 19, 2022, 5:42 a.m. | OK | PyPy 3-64 | TESTS | 15 | 62 | 1638400 | ||
181534446 | rameshguptha1 | B | Nov. 18, 2022, 7:35 p.m. | OK | PyPy 3-64 | TESTS | 12 | 62 | 1740800 | ||
181534119 | Fsxdx | B | Nov. 18, 2022, 7:31 p.m. | OK | PyPy 3-64 | TESTS | 12 | 62 | 1740800 | ||
181534054 | Slamur | B | Nov. 18, 2022, 7:30 p.m. | OK | PyPy 3-64 | TESTS | 12 | 62 | 1740800 | ||
181528485 | hkwu6013 | B | Nov. 18, 2022, 6:29 p.m. | OK | PyPy 3-64 | TESTS | 12 | 62 | 1740800 | ||
181516609 | creepybugbear | B | Nov. 18, 2022, 4:59 p.m. | OK | PyPy 3-64 | TESTS | 5 | 62 | 1740800 | ||
181515410 | khoiduong2913 | B | Nov. 18, 2022, 4:53 p.m. | OK | PyPy 3-64 | TESTS | 5 | 62 | 1740800 | ||
181523049 | gokulraaj59 | B | Nov. 18, 2022, 5:38 p.m. | OK | Python 3 | TESTS | 5 | 31 | 0 | ||
181522813 | bekeygul | B | Nov. 18, 2022, 5:36 p.m. | OK | Python 3 | TESTS | 5 | 31 | 0 | ||
181521423 | Misha2483 | B | Nov. 18, 2022, 5:26 p.m. | OK | Python 3 | TESTS | 5 | 31 | 0 | ||
181521239 | eugalt | B | Nov. 18, 2022, 5:25 p.m. | OK | Python 3 | TESTS | 5 | 31 | 0 | ||
181516309 | chipz_1008 | B | Nov. 18, 2022, 4:57 p.m. | OK | Python 3 | TESTS | 5 | 31 | 0 | ||
181514899 | Mohit0102 | B | Nov. 18, 2022, 4:52 p.m. | OK | Python 3 | TESTS | 5 | 31 | 0 | ||
181514112 | ashikarjen | B | Nov. 18, 2022, 4:49 p.m. | OK | Python 3 | TESTS | 5 | 31 | 0 | ||
181511376 | zerer | B | Nov. 18, 2022, 4:44 p.m. | OK | Python 3 | TESTS | 5 | 31 | 0 | ||
181560112 | thewrongmystery | B | Nov. 19, 2022, 4:53 a.m. | OK | Python 3 | TESTS | 15 | 46 | 0 | ||
181560087 | thewrongmystery | B | Nov. 19, 2022, 4:53 a.m. | OK | Python 3 | TESTS | 15 | 46 | 0 | ||
181541151 | liut | B | Nov. 18, 2022, 9:14 p.m. | OK | Rust 2021 | TESTS | 15 | 15 | 0 |
Back to search problems