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 |
---|---|---|---|---|---|---|
1413 | Technocup 2021 - Elimination Round 1 | FINISHED | False | 7200 | 133556063 | Oct. 25, 2020, 11:05 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 5792 ) | C | Perform Easily | PROGRAMMING | data structures dp implementation sortings two pointers |
B"After battling Shikamaru, Tayuya decided that her flute is too predictable, and replaced it with a guitar. The guitar has 6 strings and an infinite number of frets numbered from 1 . Fretting the fret number j on the i -th string produces the note a_{i} + j . Tayuya wants to play a melody of n notes. Each note can be played on different string-fret combination. The easiness of performance depends on the difference between the maximal and the minimal indices of used frets. The less this difference is, the easier it is to perform the technique. Please determine the minimal possible difference. For example, if a = [1, 1, 2, 2, 3, 3] , and the sequence of notes is 4, 11, 11, 12, 12, 13, 13 (corresponding to the second example), we can play the first note on the first string, and all the other notes on the sixth string. Then the maximal fret will be 10 , the minimal one will be 3 , and the answer is 10 - 3 = 7 , as shown on the picture. The first line contains 6 space-separated numbers a_{1} , a_{2} , ..., a_{6} ( 1 <= q a_{i} <= q 10^{9} ) which describe the Tayuya's strings. The second line contains the only integer n ( 1 <= q n <= q 100 ,000 ) standing for the number of notes in the melody. The third line consists of n integers b_{1} , b_{2} , ..., b_{n} ( 1 <= q b_{i} <= q 10^{9} ), separated by space. They describe the notes to be played. It's guaranteed that b_i > a_j for all 1 <= q i <= q n and 1 <= q j <= q 6 , in other words, you can play each note on any string. Print the minimal possible difference of the maximal and the minimal indices of used frets. In the first sample test it is optimal to play the first note on the first string, the second note on the second string, the third note on the sixth string, the fourth note on the fourth string, the fifth note on the fifth string, and the sixth note on the third string. In"... |
Codeforces Round 679 (Div. 1, Div. 2) and Technocup Round 1 editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
96707393 | Cherrt_AK_IOI | C | Oct. 25, 2020, 2:34 p.m. | OK | GNU C++11 | TESTS | 26 | 46 | 2048000 | ||
96701036 | namespace_std | C | Oct. 25, 2020, 1:30 p.m. | OK | GNU C++11 | TESTS | 26 | 93 | 22323200 | ||
96709220 | mikoo | C | Oct. 25, 2020, 2:56 p.m. | OK | GNU C++11 | TESTS | 26 | 140 | 13414400 | ||
96701007 | huanggs | C | Oct. 25, 2020, 1:30 p.m. | OK | GNU C++11 | TESTS | 26 | 155 | 13619200 | ||
96666858 | zakhar0 | C | Oct. 25, 2020, 11:40 a.m. | OK | GNU C++11 | TESTS | 26 | 156 | 3993600 | ||
96660822 | TryMax | C | Oct. 25, 2020, 11:27 a.m. | OK | GNU C++11 | TESTS | 26 | 171 | 27648000 | ||
96739147 | hht2005 | C | Oct. 26, 2020, 1:40 a.m. | OK | GNU C++11 | TESTS | 26 | 234 | 14438400 | ||
96747259 | tianbu | C | Oct. 26, 2020, 5:22 a.m. | OK | GNU C++11 | TESTS | 26 | 265 | 5222400 | ||
96701067 | s_r_f | C | Oct. 25, 2020, 1:31 p.m. | OK | GNU C++11 | TESTS | 26 | 280 | 22528000 | ||
96675327 | Lylova | C | Oct. 25, 2020, 11:59 a.m. | OK | GNU C++11 | TESTS | 26 | 311 | 12595200 | ||
96744511 | ChesterKing | C | Oct. 26, 2020, 4:18 a.m. | OK | GNU C++14 | TESTS | 26 | 93 | 5222400 | ||
96740388 | Baurr | C | Oct. 26, 2020, 2:21 a.m. | OK | GNU C++14 | TESTS | 26 | 109 | 12697600 | ||
96742472 | juggernaut | C | Oct. 26, 2020, 3:19 a.m. | OK | GNU C++14 | TESTS | 26 | 109 | 13414400 | ||
96736490 | C137 | C | Oct. 26, 2020, 12:01 a.m. | OK | GNU C++14 | TESTS | 26 | 109 | 18227200 | ||
96674695 | Tomukaro | C | Oct. 25, 2020, 11:58 a.m. | OK | GNU C++14 | TESTS | 26 | 124 | 13004800 | ||
96713666 | husseincoder | C | Oct. 25, 2020, 3:54 p.m. | OK | GNU C++14 | TESTS | 26 | 124 | 13824000 | ||
96710989 | adhklp | C | Oct. 25, 2020, 3:18 p.m. | OK | GNU C++14 | TESTS | 26 | 124 | 15257600 | ||
96704873 | Ulianafiz | C | Oct. 25, 2020, 2:06 p.m. | OK | GNU C++14 | TESTS | 26 | 139 | 26828800 | ||
96711920 | Evilandrew | C | Oct. 25, 2020, 3:30 p.m. | OK | GNU C++14 | TESTS | 26 | 140 | 8806400 | ||
96703896 | All1gator | C | Oct. 25, 2020, 1:57 p.m. | OK | GNU C++14 | TESTS | 26 | 140 | 26112000 | ||
96678220 | petrtsv | C | Oct. 25, 2020, 12:07 p.m. | OK | GNU C++17 | TESTS | 26 | 77 | 7065600 | ||
96680122 | igorfardoc | C | Oct. 25, 2020, 12:12 p.m. | OK | GNU C++17 | TESTS | 26 | 78 | 5632000 | ||
96666116 | Brovko | C | Oct. 25, 2020, 11:38 a.m. | OK | GNU C++17 | TESTS | 26 | 93 | 409600 | ||
96676107 | Alesandro2005 | C | Oct. 25, 2020, 12:01 p.m. | OK | GNU C++17 | TESTS | 26 | 93 | 1228800 | ||
96677856 | maximrufed | C | Oct. 25, 2020, 12:06 p.m. | OK | GNU C++17 | TESTS | 26 | 93 | 13414400 | ||
96701493 | zhouzhendong | C | Oct. 25, 2020, 1:37 p.m. | OK | GNU C++17 | TESTS | 26 | 108 | 2560000 | ||
96668331 | EndRay | C | Oct. 25, 2020, 11:43 a.m. | OK | GNU C++17 | TESTS | 26 | 108 | 3788800 | ||
96686637 | SashOK_Yatsuk | C | Oct. 25, 2020, 12:31 p.m. | OK | GNU C++17 | TESTS | 26 | 108 | 5222400 | ||
96700548 | vasilykuzmin22 | C | Oct. 25, 2020, 1:21 p.m. | OK | GNU C++17 | TESTS | 26 | 109 | 2764800 | ||
96701422 | Right985 | C | Oct. 25, 2020, 1:37 p.m. | OK | GNU C++17 | TESTS | 26 | 109 | 2867200 | ||
96690834 | gmusya | C | Oct. 25, 2020, 12:43 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 77 | 409600 | ||
96663041 | Gashintare | C | Oct. 25, 2020, 11:31 a.m. | OK | GNU C++17 (64) | TESTS | 26 | 93 | 6041600 | ||
96664346 | Arayi | C | Oct. 25, 2020, 11:34 a.m. | OK | GNU C++17 (64) | TESTS | 26 | 93 | 7168000 | ||
96681785 | I.Gleb | C | Oct. 25, 2020, 12:17 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 93 | 10444800 | ||
96695326 | EvgeniyPanasenkov | C | Oct. 25, 2020, 12:56 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 93 | 11264000 | ||
96674857 | IgorI | C | Oct. 25, 2020, 11:58 a.m. | OK | GNU C++17 (64) | TESTS | 26 | 93 | 13414400 | ||
96695996 | otter_18 | C | Oct. 25, 2020, 12:57 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 93 | 13721600 | ||
96705096 | Dmitry10005 | C | Oct. 25, 2020, 2:08 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 93 | 14131200 | ||
96705048 | Dmitry10005 | C | Oct. 25, 2020, 2:08 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 93 | 14131200 | ||
96708353 | keepers | C | Oct. 25, 2020, 2:45 p.m. | OK | GNU C++17 (64) | TESTS | 26 | 93 | 14950400 | ||
96736420 | Slamur | C | Oct. 25, 2020, 11:58 p.m. | OK | Java 11 | TESTS | 26 | 482 | 42700800 | ||
96735412 | ritesharma | C | Oct. 25, 2020, 11:09 p.m. | OK | Java 11 | TESTS | 26 | 576 | 90316800 | ||
96736371 | Slamur | C | Oct. 25, 2020, 11:56 p.m. | OK | Java 11 | TESTS | 26 | 795 | 43417600 | ||
96736355 | Slamur | C | Oct. 25, 2020, 11:55 p.m. | OK | Java 11 | TESTS | 26 | 841 | 53350400 | ||
96716563 | idk321 | C | Oct. 25, 2020, 4:34 p.m. | OK | Java 11 | TESTS | 26 | 858 | 36249600 | ||
96675813 | Witless_Deer | C | Oct. 25, 2020, 12:01 p.m. | OK | Java 11 | TESTS | 26 | 1840 | 17305600 | ||
96736320 | Slamur | C | Oct. 25, 2020, 11:54 p.m. | OK | Java 8 | TESTS | 26 | 795 | 50380800 | ||
96726202 | an09mous | C | Oct. 25, 2020, 7:14 p.m. | OK | Java 8 | TESTS | 26 | 1512 | 11468800 | ||
96728565 | koper | C | Oct. 25, 2020, 8:01 p.m. | OK | Kotlin | TESTS | 26 | 1965 | 81408000 | ||
96668938 | n.a.orlov | C | Oct. 25, 2020, 11:44 a.m. | OK | MS C++ 2017 | TESTS | 26 | 202 | 20275200 | ||
96690946 | lioshik_ | C | Oct. 25, 2020, 12:43 p.m. | OK | MS C++ 2017 | TESTS | 26 | 1435 | 67481600 | ||
96702853 | Tim4757 | C | Oct. 25, 2020, 1:48 p.m. | OK | PyPy 3 | TESTS | 26 | 1294 | 43315200 | ||
96670355 | EzikBro | C | Oct. 25, 2020, 11:47 a.m. | OK | PyPy 3 | TESTS | 26 | 1622 | 43212800 | ||
96730167 | sery76 | C | Oct. 25, 2020, 8:40 p.m. | OK | PyPy 3 | TESTS | 26 | 1668 | 37785600 | ||
96705699 | Nifer | C | Oct. 25, 2020, 2:14 p.m. | OK | PyPy 3 | TESTS | 26 | 1824 | 49766400 | ||
96706054 | Nifer | C | Oct. 25, 2020, 2:18 p.m. | OK | PyPy 3 | TESTS | 26 | 1840 | 47308800 | ||
96706322 | Nifer | C | Oct. 25, 2020, 2:21 p.m. | OK | PyPy 3 | TESTS | 26 | 1902 | 47308800 | ||
96704243 | anishde85 | C | Oct. 25, 2020, 2 p.m. | OK | PyPy 3 | TESTS | 26 | 1949 | 36761600 | ||
96729228 | myotra | C | Oct. 25, 2020, 8:17 p.m. | OK | PyPy 3 | TESTS | 26 | 1949 | 42086400 | ||
96727600 | sery76 | C | Oct. 25, 2020, 7:40 p.m. | OK | PyPy 3 | TESTS | 26 | 1949 | 55398400 | ||
96701150 | Nifer | C | Oct. 25, 2020, 1:32 p.m. | OK | PyPy 3 | TESTS | 26 | 1965 | 79360000 | ||
96729534 | sery76 | C | Oct. 25, 2020, 8:25 p.m. | OK | Python 3 | TESTS | 26 | 1777 | 41984000 | ||
96724853 | myotra | C | Oct. 25, 2020, 6:51 p.m. | OK | Python 3 | TESTS | 26 | 1855 | 41062400 | ||
96729641 | sery76 | C | Oct. 25, 2020, 8:27 p.m. | OK | Python 3 | TESTS | 26 | 1887 | 41984000 | ||
96729424 | sery76 | C | Oct. 25, 2020, 8:22 p.m. | OK | Python 3 | TESTS | 26 | 1918 | 41881600 | ||
96730067 | sery76 | C | Oct. 25, 2020, 8:38 p.m. | OK | Python 3 | TESTS | 26 | 1933 | 41881600 | ||
96729478 | sery76 | C | Oct. 25, 2020, 8:23 p.m. | OK | Python 3 | TESTS | 26 | 1950 | 41881600 | ||
96728347 | sery76 | C | Oct. 25, 2020, 7:56 p.m. | OK | Python 3 | TESTS | 26 | 1996 | 46694400 |
Back to search problems