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 |
---|---|---|---|---|---|---|
1935 | Codeforces Round 932 (Div. 2) | FINISHED | False | 7200 | 27530663 | March 5, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 19133 ) | B | Informatics in MAC | PROGRAMMING | constructive algorithms |
B"In the Master's Assistance Center, Nyam-Nyam was given a homework assignment in informatics. There is an array a of length n , and you want to divide it into k > 1 subsegments ^{ dagger} in such a way that the operatorname{MEX} ^{ ddagger} on each subsegment is equal to the same integer. Help Nyam-Nyam find any suitable division, or determine that it does not exist. ^{ dagger} A division of an array into k subsegments is defined as k pairs of integers (l_1, r_1), (l_2, r_2), ldots, (l_k, r_k) such that l_i <= r_i and for each 1 <= j <= k - 1 , l_{j + 1} = r_j + 1 , and also l_1 = 1 and r_k = n . These pairs represent the subsegments themselves. ^{ ddagger} operatorname{MEX} of an array is the smallest non-negative integer that does not belong to the array. For example: Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 10^5 ) -- the length of the array a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i < n ) -- the elements of the array a . It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, output a single integer -1 if a suitable division does not exist. Otherwise, on the first line, output an integer k ( 2 <= k <= n ) -- the number of subsegments in the division. Then output k lines -- the division into subsegments. The i -th line should contain two integers l_i and r_i ( 1 <= l_i <= r_i <= n ) -- the boundaries of the i -th subsegment. The following conditions must be satisfied: If there are multiple possible solutions, output any of them. In the first test case, "... |
Codeforces Round #932 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
249868574 | Itssocooolyousonovabitch | B | March 5, 2024, 10:25 p.m. | OK | C++17 (GCC 7-32) | TESTS | 12 | 15 | 1228800 | ||
249850354 | long_long_hardle | B | March 5, 2024, 6:50 p.m. | OK | C++17 (GCC 7-32) | TESTS | 12 | 30 | 1638400 | ||
249841417 | kunal0612 | B | March 5, 2024, 5:46 p.m. | OK | C++17 (GCC 7-32) | TESTS | 12 | 30 | 3379200 | ||
249864738 | Qzxell | B | March 5, 2024, 9:21 p.m. | OK | C++17 (GCC 7-32) | TESTS | 12 | 31 | 409600 | ||
249845589 | .iDRiVE | B | March 5, 2024, 6:14 p.m. | OK | C++17 (GCC 7-32) | TESTS | 12 | 31 | 409600 | ||
249872555 | whoisYASH | B | March 6, 2024, 12:12 a.m. | OK | C++17 (GCC 7-32) | TESTS | 12 | 31 | 819200 | ||
249844602 | gbunuxi | B | March 5, 2024, 6:07 p.m. | OK | C++17 (GCC 7-32) | TESTS | 12 | 31 | 819200 | ||
249878709 | MKageaki | B | March 6, 2024, 2:43 a.m. | OK | C++17 (GCC 7-32) | TESTS | 30 | 31 | 921600 | ||
249866736 | rfhalb | B | March 5, 2024, 9:52 p.m. | OK | C++17 (GCC 7-32) | TESTS | 12 | 31 | 1126400 | ||
249844445 | rohan.gothwal.mat22 | B | March 5, 2024, 6:06 p.m. | OK | C++17 (GCC 7-32) | TESTS | 12 | 31 | 1126400 | ||
249874676 | HappyCodingLife. | B | March 6, 2024, 1:11 a.m. | OK | C++17 (GCC 9-64) | TESTS | 12 | 15 | 1638400 | ||
249872453 | Linjingwei0 | B | March 6, 2024, 12:09 a.m. | OK | C++17 (GCC 9-64) | TESTS | 12 | 15 | 1638400 | ||
249842523 | Orangeflavoredneck | B | March 5, 2024, 5:53 p.m. | OK | C++17 (GCC 9-64) | TESTS | 12 | 15 | 1638400 | ||
249828224 | Trainer_Marvin | B | March 5, 2024, 4:30 p.m. | OK | C++17 (GCC 9-64) | TESTS | 12 | 15 | 1945600 | ||
249883218 | xu826281112 | B | March 6, 2024, 4:03 a.m. | OK | C++17 (GCC 9-64) | TESTS | 34 | 30 | 17203200 | ||
249874535 | Enoch006 | B | March 6, 2024, 1:08 a.m. | OK | C++17 (GCC 9-64) | TESTS | 12 | 30 | 64102400 | ||
249883836 | 1234567qeq | B | March 6, 2024, 4:12 a.m. | OK | C++17 (GCC 9-64) | TESTS | 34 | 31 | 819200 | ||
249878585 | wxt1221 | B | March 6, 2024, 2:40 a.m. | OK | C++17 (GCC 9-64) | TESTS | 30 | 31 | 819200 | ||
249877003 | GordenGhost | B | March 6, 2024, 2:06 a.m. | OK | C++17 (GCC 9-64) | TESTS | 20 | 31 | 819200 | ||
249841299 | juneharold | B | March 5, 2024, 5:45 p.m. | OK | C++17 (GCC 9-64) | TESTS | 12 | 31 | 1126400 | ||
249846976 | Shree_Krushn | B | March 5, 2024, 6:24 p.m. | OK | C++20 (GCC 11-64) | TESTS | 12 | 15 | 409600 | ||
249841507 | yash_siwach | B | March 5, 2024, 5:46 p.m. | OK | C++20 (GCC 11-64) | TESTS | 12 | 15 | 409600 | ||
249873124 | yyashm1491625 | B | March 6, 2024, 12:29 a.m. | OK | C++20 (GCC 11-64) | TESTS | 12 | 15 | 819200 | ||
249857720 | farkon00 | B | March 5, 2024, 7:55 p.m. | OK | C++20 (GCC 11-64) | TESTS | 12 | 15 | 819200 | ||
249851465 | Arthas | B | March 5, 2024, 6:59 p.m. | OK | C++20 (GCC 11-64) | TESTS | 12 | 15 | 819200 | ||
249836737 | RimuruChan | B | March 5, 2024, 5:18 p.m. | OK | C++20 (GCC 11-64) | TESTS | 12 | 15 | 819200 | ||
249834771 | RimuruChan | B | March 5, 2024, 5:09 p.m. | OK | C++20 (GCC 11-64) | TESTS | 12 | 15 | 819200 | ||
249876304 | SamuelR. | B | March 6, 2024, 1:50 a.m. | OK | C++20 (GCC 11-64) | TESTS | 14 | 15 | 1228800 | ||
249872785 | Hagag | B | March 6, 2024, 12:19 a.m. | OK | C++20 (GCC 11-64) | TESTS | 12 | 15 | 1228800 | ||
249872305 | Numinous | B | March 6, 2024, 12:06 a.m. | OK | C++20 (GCC 11-64) | TESTS | 12 | 15 | 1228800 |
Back to search problems