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 |
|---|---|---|---|---|---|---|
| 737 | Codeforces Round 380 (Div. 1, Rated, Based on Technocup 2017 - Elimination Round 2) | FINISHED | False | 7200 | 296772923 | Nov. 20, 2016, 9:05 a.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 85 ) | F | Dirty plates | PROGRAMMING | constructive algorithms math | 3300 |
After one of celebrations there is a stack of dirty plates in Nikita's kitchen. Nikita has to wash them and put into a dryer. In dryer, the plates should be also placed in a stack also, and the plates sizes should increase down up. The sizes of all plates are distinct. Nikita has no so much free space, specifically, he has a place for only one more stack of plates. Therefore, he can perform only such two operations: Take any number of plates from 1 to a from the top of the dirty stack, wash them and put them to the intermediate stack. Take any number of plates from 1 to b from the top of the intermediate stack and put them to the stack in the dryer. Note that after performing each of the operations, the plates are put in the same order as they were before the operation. You are given the sizes of the plates s 1 , s 2 , ..., s n in the down up order in the dirty stack, and integers a and b . All the sizes are distinct. Write a program that determines whether or not Nikita can put the plates in increasing down up order in the dryer. If he is able to do so, the program should find some sequence of operations (not necessary optimal) to achieve it. The first line contains three integers n , a and b ( 1 ≤ n ≤ 2000 , 1 ≤ a , b ≤ n ). The second line contains integers s 1 , s 2 , ..., s n ( 1 ≤ s i ≤ n ) — the sizes of the plates in down up order. All the sizes are distinct. In the first line print " YES " if there is a solution. In this case, in the second line print integer k — the number of operations. Then in k lines print the operations, one per line. Each operation is described by two integers t j and c j , where t j = 1 , if the operation is to wash the top c j places from the dirty stack and put them onto the intermediate stack, and t j = 2 , if the operation is to move th top c j plates from the intermediate stack to the dryer. In case there is no solution, print single line " NO ". If there are multiple solutions, print any of them. Note that it is not n |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 22385052 | baxbaxa | F | Nov. 21, 2016, 2:10 p.m. | OK | GNU C++ | TESTS | 57 | 31 | 102400 | 3300 | |
| 27471014 | 754986421653 | F | May 31, 2017, 4:25 p.m. | OK | GNU C++11 | TESTS | 57 | 15 | 102400 | 3300 | |
| 22374526 | aid | F | Nov. 21, 2016, 12:08 a.m. | OK | GNU C++11 | TESTS | 57 | 30 | 102400 | 3300 | |
| 22363265 | LHiC | F | Nov. 20, 2016, 12:46 p.m. | OK | GNU C++11 | TESTS | 57 | 30 | 102400 | 3300 | |
| 54503651 | WOSHIGEPACHONG2 | F | May 23, 2019, 1:21 a.m. | OK | GNU C++11 | TESTS | 57 | 31 | 102400 | 3300 | |
| 46923366 | Itst | F | Dec. 12, 2018, 6:52 a.m. | OK | GNU C++11 | TESTS | 57 | 31 | 102400 | 3300 | |
| 46923322 | Itst | F | Dec. 12, 2018, 6:50 a.m. | OK | GNU C++11 | TESTS | 57 | 31 | 102400 | 3300 | |
| 38521709 | fuyangzhi | F | May 22, 2018, 2:23 a.m. | OK | GNU C++11 | TESTS | 57 | 31 | 102400 | 3300 | |
| 32131867 | krijgertje | F | Nov. 7, 2017, 10:39 p.m. | OK | GNU C++11 | TESTS | 57 | 31 | 102400 | 3300 | |
| 22403700 | codemasterisme | F | Nov. 22, 2016, 1:06 p.m. | OK | GNU C++11 | TESTS | 57 | 31 | 102400 | 3300 | |
| 23358621 | Ali.Pi | F | Dec. 27, 2016, 12:09 p.m. | OK | GNU C++11 | TESTS | 57 | 31 | 2150400 | 3300 | |
| 59346008 | Scut82 | F | Aug. 23, 2019, 9:42 a.m. | OK | GNU C++14 | TESTS | 57 | 30 | 204800 | 3300 | |
| 22403970 | vovanstrr | F | Nov. 22, 2016, 1:19 p.m. | OK | GNU C++14 | TESTS | 57 | 31 | 102400 | 3300 | |
| 22426937 | yosupo | F | Nov. 23, 2016, 3:52 p.m. | OK | GNU C++14 | TESTS | 57 | 31 | 204800 | 3300 | |
| 46991757 | vjudge5 | F | Dec. 14, 2018, 5:07 a.m. | OK | GNU C++14 | TESTS | 57 | 46 | 204800 | 3300 | |
| 22852431 | kastarika | F | Dec. 10, 2016, 9:54 a.m. | OK | GNU C++14 | TESTS | 57 | 46 | 204800 | 3300 | |
| 22852230 | saliii | F | Dec. 10, 2016, 9:41 a.m. | OK | GNU C++14 | TESTS | 57 | 46 | 204800 | 3300 | |
| 22457920 | oyu8201 | F | Nov. 24, 2016, 3:22 a.m. | OK | GNU C++14 | TESTS | 57 | 46 | 204800 | 3300 | |
| 34827851 | HistoryMoments | F | Feb. 2, 2018, 5:53 a.m. | OK | GNU C++14 | TESTS | 57 | 46 | 2150400 | 3300 | |
| 24360839 | MhdMohammadi | F | Feb. 2, 2017, 9:47 a.m. | OK | GNU C++14 | TESTS | 57 | 46 | 2150400 | 3300 | |
| 24360796 | Batman | F | Feb. 2, 2017, 9:45 a.m. | OK | GNU C++14 | TESTS | 57 | 46 | 2150400 | 3300 | |
| 43539825 | XTyuan | F | Sept. 28, 2018, 4:45 p.m. | OK | GNU C++17 | TESTS | 57 | 30 | 307200 | 3300 | |
| 69663547 | gongsuidashen | F | Jan. 28, 2020, 10:25 a.m. | OK | GNU C++17 | TESTS | 57 | 31 | 102400 | 3300 | |
| 51132070 | xzkkjm | F | March 10, 2019, 2:09 p.m. | OK | GNU C++17 | TESTS | 57 | 31 | 102400 | 3300 | |
| 57344216 | Benq | F | July 19, 2019, 9:07 p.m. | OK | GNU C++17 | TESTS | 57 | 31 | 204800 | 3300 | |
| 46001724 | Shayan.P | F | Nov. 20, 2018, 2:50 p.m. | OK | GNU C++17 | TESTS | 57 | 46 | 614400 | 3300 | |
| 23419706 | Los_Angelos_Laycurse | F | Dec. 30, 2016, 1:01 p.m. | OK | MS C++ | TESTS | 57 | 15 | 2150400 | 3300 | |
| 23419617 | Los_Angelos_Laycurse | F | Dec. 30, 2016, 12:57 p.m. | OK | MS C++ | TESTS | 57 | 15 | 2969600 | 3300 | |
| 23419550 | Los_Angelos_Laycurse | F | Dec. 30, 2016, 12:52 p.m. | OK | MS C++ | TESTS | 57 | 15 | 2969600 | 3300 | |
| 23419515 | Los_Angelos_Laycurse | F | Dec. 30, 2016, 12:50 p.m. | OK | MS C++ | TESTS | 57 | 15 | 2969600 | 3300 | |
| 40983121 | ReaLNero1 | F | July 30, 2018, 6:44 p.m. | OK | MS C++ | TESTS | 57 | 31 | 921600 | 3300 | |
| 23419465 | Los_Angelos_Laycurse | F | Dec. 30, 2016, 12:47 p.m. | OK | MS C++ | TESTS | 57 | 31 | 2969600 | 3300 |
Back to search problems