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 |
---|---|---|---|---|---|---|
1556 | Deltix Round, Summer 2021 (open for everyone, rated, Div. 1 + Div. 2) | FINISHED | False | 9000 | 101575499 | Aug. 29, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2731 ) | E | Equilibrium | PROGRAMMING | data structures greedy | 2200 |
B'William has two arrays a and b , each consisting of n items. For some segments l..r of these arrays William wants to know if it is possible to equalize the values of items in these segments using a balancing operation. Formally, the values are equalized if for each i from l to r holds a_i = b_i . To perform a balancing operation an even number of indices must be selected, such that l <= pos_1 < pos_2 < ... < pos_k <= r . Next the items of array a at positions pos_1, pos_3, pos_5, ... get incremented by one and the items of array b at positions pos_2, pos_4, pos_6, ... get incremented by one. William wants to find out if it is possible to equalize the values of elements in two arrays for each segment using some number of balancing operations, and what is the minimal number of operations required for that. Note that for each segment the operations are performed independently. The first line contains a two integers n and q ( 2 <= n <= 10^5 , 1 <= q <= 10^5 ), the size of arrays a and b and the number of segments. The second line contains n integers a_1, a_2, ... , a_n (0 <= a_i <= 10^9) . The third line contains n integers b_1, b_2, ... , b_n (0 <= b_i <= 10^9) . Each of the next q lines contains two integers l_i and r_i (1 <= l_i < r_i <= n) , the edges of segments. For each segment output a single number -- the minimal number of balancing operations needed or "-1" if it is impossible to equalize segments of arrays. For the first segment from 2 to 6 you can do one operation with pos = [2, 3, 5, 6] , after this operation the arrays will be: a = [0, 2, 2, 9, 4, 2, 7, 5] , b = [2, 2, 2, 9, 4, 2, 5, 8] . Arrays are equal on a segment from 2 to 6 after this operation. For the second segment from 1 to 7 you can do three following operations: '... |
94384 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
127391321 | Gassa | E | Aug. 29, 2021, 5:03 p.m. | OK | D | TESTS | 80 | 405 | 20377600 | 2200 | |
127413044 | BILL666 | E | Aug. 30, 2021, 3:25 a.m. | OK | GNU C++14 | TESTS | 91 | 155 | 37376000 | 2200 | |
127383469 | ssl_wyc | E | Aug. 29, 2021, 4:38 p.m. | OK | GNU C++14 | TESTS | 80 | 171 | 11264000 | 2200 | |
127402792 | Potassium | E | Aug. 29, 2021, 8:52 p.m. | OK | GNU C++14 | TESTS | 90 | 171 | 32256000 | 2200 | |
127383646 | tokitsukaze | E | Aug. 29, 2021, 4:39 p.m. | OK | GNU C++14 | TESTS | 80 | 171 | 229888000 | 2200 | |
127393982 | sinamhdv | E | Aug. 29, 2021, 6:04 p.m. | OK | GNU C++14 | TESTS | 80 | 186 | 7782400 | 2200 | |
127384361 | NeverGonnaKnowWhoAmI | E | Aug. 29, 2021, 4:41 p.m. | OK | GNU C++14 | TESTS | 80 | 186 | 33792000 | 2200 | |
127394662 | Darko1227 | E | Aug. 29, 2021, 6:08 p.m. | OK | GNU C++14 | TESTS | 80 | 186 | 37785600 | 2200 | |
127386011 | unk2001 | E | Aug. 29, 2021, 4:47 p.m. | OK | GNU C++14 | TESTS | 80 | 186 | 38195200 | 2200 | |
127414395 | tianbu | E | Aug. 30, 2021, 3:56 a.m. | OK | GNU C++14 | TESTS | 91 | 187 | 11161600 | 2200 | |
127410984 | 18Michael | E | Aug. 30, 2021, 2:33 a.m. | OK | GNU C++14 | TESTS | 91 | 187 | 11366400 | 2200 | |
127410125 | XyzL | E | Aug. 30, 2021, 2:07 a.m. | OK | GNU C++17 | TESTS | 91 | 93 | 43724800 | 2200 | |
127409965 | acwing_meow | E | Aug. 30, 2021, 2:02 a.m. | OK | GNU C++17 | TESTS | 91 | 124 | 32563200 | 2200 | |
127414168 | colazcy | E | Aug. 30, 2021, 3:51 a.m. | OK | GNU C++17 | TESTS | 91 | 155 | 40243200 | 2200 | |
127400184 | cs142857 | E | Aug. 29, 2021, 7:39 p.m. | OK | GNU C++17 | TESTS | 90 | 156 | 20992000 | 2200 | |
127397080 | YaKon4ick | E | Aug. 29, 2021, 6:38 p.m. | OK | GNU C++17 | TESTS | 90 | 170 | 8601600 | 2200 | |
127409932 | acwing_meow | E | Aug. 30, 2021, 2 a.m. | OK | GNU C++17 | TESTS | 91 | 171 | 11366400 | 2200 | |
127403792 | Tiagodfs | E | Aug. 29, 2021, 9:25 p.m. | OK | GNU C++17 | TESTS | 90 | 171 | 11366400 | 2200 | |
127404929 | Gekk | E | Aug. 29, 2021, 10:08 p.m. | OK | GNU C++17 | TESTS | 90 | 171 | 31436800 | 2200 | |
127404751 | Gekk | E | Aug. 29, 2021, 10:01 p.m. | OK | GNU C++17 | TESTS | 90 | 171 | 31436800 | 2200 | |
127399845 | NothingXD | E | Aug. 29, 2021, 7:31 p.m. | OK | GNU C++17 | TESTS | 90 | 171 | 37376000 | 2200 | |
127383172 | allfadeaway | E | Aug. 29, 2021, 4:37 p.m. | OK | GNU C++17 (64) | TESTS | 80 | 78 | 109568000 | 2200 | |
127413051 | Backseat-Stargazer | E | Aug. 30, 2021, 3:25 a.m. | OK | GNU C++17 (64) | TESTS | 91 | 93 | 24473600 | 2200 | |
127382426 | WeakestTopology | E | Aug. 29, 2021, 4:34 p.m. | OK | GNU C++17 (64) | TESTS | 80 | 109 | 7884800 | 2200 | |
127394337 | KKT_89 | E | Aug. 29, 2021, 6:06 p.m. | OK | GNU C++17 (64) | TESTS | 80 | 109 | 11571200 | 2200 | |
127382439 | Be_dos | E | Aug. 29, 2021, 4:34 p.m. | OK | GNU C++17 (64) | TESTS | 80 | 109 | 18124800 | 2200 | |
127394547 | uuku | E | Aug. 29, 2021, 6:08 p.m. | OK | GNU C++17 (64) | TESTS | 80 | 109 | 40960000 | 2200 | |
127394738 | kitsune | E | Aug. 29, 2021, 6:09 p.m. | OK | GNU C++17 (64) | TESTS | 80 | 124 | 9113600 | 2200 | |
127394471 | sotanishy | E | Aug. 29, 2021, 6:07 p.m. | OK | GNU C++17 (64) | TESTS | 80 | 124 | 10137600 | 2200 | |
127395518 | aryan57 | E | Aug. 29, 2021, 6:17 p.m. | OK | GNU C++17 (64) | TESTS | 89 | 124 | 10956800 | 2200 | |
127403224 | hostelsex | E | Aug. 29, 2021, 9:06 p.m. | OK | GNU C++17 (64) | TESTS | 90 | 124 | 11571200 | 2200 | |
127388709 | clyring | E | Aug. 29, 2021, 4:57 p.m. | OK | Haskell | TESTS | 80 | 514 | 49459200 | 2200 | |
127388784 | pulkit1411 | E | Aug. 29, 2021, 4:57 p.m. | OK | Java 11 | TESTS | 80 | 452 | 54272000 | 2200 | |
127380644 | martins | E | Aug. 29, 2021, 4:28 p.m. | OK | Java 11 | TESTS | 80 | 514 | 39628800 | 2200 | |
127389681 | Justyo | E | Aug. 29, 2021, 5 p.m. | OK | Java 11 | TESTS | 80 | 560 | 31948800 | 2200 | |
127397548 | Dukkha | E | Aug. 29, 2021, 6:45 p.m. | OK | Java 11 | TESTS | 90 | 733 | 24473600 | 2200 | |
127405963 | Restricted | E | Aug. 29, 2021, 10:59 p.m. | OK | Java 8 | TESTS | 90 | 343 | 26419200 | 2200 | |
127385189 | hu_tao | E | Aug. 29, 2021, 4:45 p.m. | OK | Java 8 | TESTS | 80 | 436 | 29388800 | 2200 | |
127379963 | SaveVMK | E | Aug. 29, 2021, 4:26 p.m. | OK | Java 8 | TESTS | 80 | 1543 | 94105600 | 2200 | |
127388603 | Hakiobo | E | Aug. 29, 2021, 4:56 p.m. | OK | Kotlin | TESTS | 80 | 311 | 38092800 | 2200 | |
127403781 | Eldies | E | Aug. 29, 2021, 9:25 p.m. | OK | MS C++ 2017 | TESTS | 90 | 670 | 19353600 | 2200 | |
127402616 | Eldies | E | Aug. 29, 2021, 8:46 p.m. | OK | MS C++ 2017 | TESTS | 90 | 670 | 19353600 | 2200 | |
127399497 | titia | E | Aug. 29, 2021, 7:23 p.m. | OK | PyPy 3 | TESTS | 90 | 483 | 52019200 | 2200 | |
127396755 | sh1194 | E | Aug. 29, 2021, 6:33 p.m. | OK | PyPy 3 | TESTS | 90 | 483 | 52428800 | 2200 | |
127396495 | sh1194 | E | Aug. 29, 2021, 6:29 p.m. | OK | PyPy 3 | TESTS | 90 | 498 | 51712000 | 2200 | |
127382772 | titia | E | Aug. 29, 2021, 4:36 p.m. | OK | PyPy 3 | TESTS | 80 | 576 | 52224000 | 2200 | |
127386112 | plevande | E | Aug. 29, 2021, 4:48 p.m. | OK | PyPy 3 | TESTS | 80 | 1326 | 49664000 | 2200 | |
127387505 | Igrmi | E | Aug. 29, 2021, 4:52 p.m. | OK | PyPy 3 | TESTS | 80 | 1809 | 42188800 | 2200 | |
127386380 | sansen | E | Aug. 29, 2021, 4:49 p.m. | OK | Rust | TESTS | 80 | 108 | 20480000 | 2200 | |
127384977 | apilat | E | Aug. 29, 2021, 4:44 p.m. | OK | Rust | TESTS | 80 | 170 | 10240000 | 2200 |
Back to search problems