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 |
---|---|---|---|---|---|---|
1864 | Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 44119463 | Aug. 26, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1473 ) | F | Exotic Queries | PROGRAMMING | brute force data structures implementation sortings |
B'AquaMoon gives RiverHamster a sequence of integers a_1,a_2, ... ,a_n , and RiverHamster gives you q queries. Each query is expressed by two integers l and r . For each query independently, you can take any continuous segment of the sequence and subtract an identical non-negative value from all the numbers of this segment. You can do so multiple (possibly, zero) times. However, you may not choose two intersecting segments which are not included in one another. Your goal is to convert to 0 all numbers whose initial value was within the range [l, r] . You must do so in the minimum number of operations. Please note that the queries are independent, the numbers in the array are restored to their initial values between the queries. Formally, for each query, you are to find the smallest m such that there exists a sequence {(x_j,y_j,z_j) }_{j=1}^{m} satisfying the following conditions: The first line contains two integers n and q ( 1 <= n,q <= 10^6 ). The second line contains n integers integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ). Each of the next q lines contains two integers l and r ( 1 <= l <= r <= n ), representing a query. For each query, output the answer for this query on a separate line. In the first test case, consider the second query, when l = 2 , r = 2 . The elements to be manipulated are [a_3, a_5, a_{10}] = [2, 2, 2] . It is sufficient to apply the operation sequence {(2, 10, 2) } . Consider the fourth query, when l = 2 , r = 3 . The elements to be manipulated are [a_3, a_4, a_5, a_7, a_{10}] = [2, 3, 2, 3, 2] . It is sufficient to apply the operation sequence {(1, 10, 2), (4, 4, 1), (7, 7, 1) } . In the second test case, note that the operation sequence {(1, 2, 1), (2, 3, 2) } is invalid because the two segments intersect but neither is contained inside the other. '... |
Harbour.Space Scholarship Contest 2023-2024 (Div. 1 + Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
220628631 | chro4896 | F | Aug. 27, 2023, 2:42 a.m. | OK | GNU C11 | TESTS | 87 | 1949 | 52736000 | ||
220634133 | Sukwants | F | Aug. 27, 2023, 4:29 a.m. | OK | GNU C++14 | TESTS | 87 | 1528 | 84377600 | ||
220592404 | MasterCactus | F | Aug. 26, 2023, 5:15 p.m. | OK | GNU C++14 | TESTS | 87 | 1543 | 118169600 | ||
220591408 | Sukwants | F | Aug. 26, 2023, 5:11 p.m. | OK | GNU C++14 | TESTS | 87 | 1559 | 84377600 | ||
220631897 | Sukwants | F | Aug. 27, 2023, 3:46 a.m. | OK | GNU C++14 | TESTS | 87 | 1559 | 84377600 | ||
220632696 | Iztrx | F | Aug. 27, 2023, 4:02 a.m. | OK | GNU C++14 | TESTS | 87 | 1560 | 92364800 | ||
220632145 | E-ray | F | Aug. 27, 2023, 3:52 a.m. | OK | GNU C++14 | TESTS | 87 | 1590 | 100659200 | ||
220631000 | _Fake4Fun | F | Aug. 27, 2023, 3:28 a.m. | OK | GNU C++14 | TESTS | 87 | 1606 | 93900800 | ||
220632383 | bkifhr6 | F | Aug. 27, 2023, 3:56 a.m. | OK | GNU C++14 | TESTS | 87 | 1621 | 100659200 | ||
220607849 | Farhod_Farmon | F | Aug. 26, 2023, 7:55 p.m. | OK | GNU C++14 | TESTS | 87 | 1653 | 81920000 | ||
220631457 | XZC__Bobby | F | Aug. 27, 2023, 3:38 a.m. | OK | GNU C++14 | TESTS | 87 | 1653 | 85913600 | ||
220626737 | old_wrp | F | Aug. 27, 2023, 1:59 a.m. | OK | GNU C++17 | TESTS | 87 | 1185 | 99942400 | ||
220607528 | happy.potato | F | Aug. 26, 2023, 7:53 p.m. | OK | GNU C++17 | TESTS | 87 | 1263 | 64102400 | ||
220609862 | Dominater069 | F | Aug. 26, 2023, 8:16 p.m. | OK | GNU C++17 | TESTS | 87 | 1263 | 64102400 | ||
220609318 | areke | F | Aug. 26, 2023, 8:10 p.m. | OK | GNU C++17 | TESTS | 87 | 1263 | 70963200 | ||
220611848 | Hack.404 | F | Aug. 26, 2023, 8:38 p.m. | OK | GNU C++17 | TESTS | 87 | 1294 | 70963200 | ||
220610769 | juliany2 | F | Aug. 26, 2023, 8:26 p.m. | OK | GNU C++17 | TESTS | 87 | 1309 | 78131200 | ||
220609757 | juliany2 | F | Aug. 26, 2023, 8:15 p.m. | OK | GNU C++17 | TESTS | 87 | 1325 | 70963200 | ||
220587143 | gabrielwu | F | Aug. 26, 2023, 4:55 p.m. | OK | GNU C++17 | TESTS | 87 | 1341 | 65740800 | ||
220610510 | juliany2 | F | Aug. 26, 2023, 8:23 p.m. | OK | GNU C++17 | TESTS | 87 | 1387 | 71065600 | ||
220611376 | juliany2 | F | Aug. 26, 2023, 8:32 p.m. | OK | GNU C++17 | TESTS | 87 | 1419 | 82534400 | ||
220630619 | qq_orange | F | Aug. 27, 2023, 3:21 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 748 | 104550400 | ||
220617909 | Sana | F | Aug. 26, 2023, 10:12 p.m. | OK | GNU C++17 (64) | TESTS | 87 | 1122 | 84684800 | ||
220626424 | qq_orange | F | Aug. 27, 2023, 1:52 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 1122 | 112230400 | ||
220627671 | camc | F | Aug. 27, 2023, 2:21 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 1185 | 78745600 | ||
220630871 | udon1206 | F | Aug. 27, 2023, 3:26 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 1185 | 97075200 | ||
220626163 | enslaved | F | Aug. 27, 2023, 1:45 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 1372 | 132300800 | ||
220624425 | lunchbox | F | Aug. 27, 2023, 1:01 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 1419 | 135884800 | ||
220623962 | drdilyor | F | Aug. 27, 2023, 12:49 a.m. | OK | GNU C++17 (64) | TESTS | 87 | 1450 | 128307200 | ||
220583348 | Bucketsmith | F | Aug. 26, 2023, 4:42 p.m. | OK | GNU C++17 (64) | TESTS | 87 | 1622 | 124006400 | ||
220622190 | stan23456 | F | Aug. 27, 2023, midnight | OK | GNU C++17 (64) | TESTS | 87 | 1637 | 107724800 | ||
220607136 | tiom4eg | F | Aug. 26, 2023, 7:50 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 873 | 108646400 | ||
220607482 | Iztrx | F | Aug. 26, 2023, 7:52 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 904 | 106393600 | ||
220607570 | Iztrx | F | Aug. 26, 2023, 7:53 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 920 | 106393600 | ||
220608103 | Iztrx | F | Aug. 26, 2023, 7:57 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 920 | 106393600 | ||
220614368 | areke | F | Aug. 26, 2023, 9:11 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 982 | 75264000 | ||
220631130 | Anhdung1478 | F | Aug. 27, 2023, 3:31 a.m. | OK | GNU C++20 (64) | TESTS | 87 | 998 | 52121600 | ||
220631408 | Anhdung147 | F | Aug. 27, 2023, 3:37 a.m. | OK | GNU C++20 (64) | TESTS | 87 | 998 | 52121600 | ||
220615754 | eggag32 | F | Aug. 26, 2023, 9:33 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 998 | 75264000 | ||
220611606 | areke | F | Aug. 26, 2023, 8:35 p.m. | OK | GNU C++20 (64) | TESTS | 87 | 1044 | 83456000 | ||
220629680 | IceYukino | F | Aug. 27, 2023, 3:04 a.m. | OK | GNU C++20 (64) | TESTS | 87 | 1044 | 162201600 | ||
220590900 | SecondThread | F | Aug. 26, 2023, 5:09 p.m. | OK | Java 8 | TESTS | 87 | 3993 | 449228800 | ||
220618021 | hxu10 | F | Aug. 26, 2023, 10:15 p.m. | OK | PyPy 3 | TESTS | 87 | 3993 | 240230400 | ||
220594614 | misorin | F | Aug. 26, 2023, 5:24 p.m. | OK | PyPy 3-64 | TESTS | 87 | 2214 | 190156800 | ||
220617922 | hxu10 | F | Aug. 26, 2023, 10:12 p.m. | OK | PyPy 3-64 | TESTS | 87 | 3853 | 408576000 |
Back to search problems