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 |
---|---|---|---|---|---|---|
1550 | Educational Codeforces Round 111 (Rated for Div. 2) | FINISHED | False | 7200 | 105549899 | July 14, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 10237 ) | C | Manhattan Subarrays | PROGRAMMING | brute force geometry greedy implementation |
B"Suppose you have two points p = (x_p, y_p) and q = (x_q, y_q) . Let's denote the Manhattan distance between them as d(p, q) = |x_p - x_q| + |y_p - y_q| . Let's say that three points p , q , r form a bad triple if d(p, r) = d(p, q) + d(q, r) . Let's say that an array b_1, b_2, ... , b_m is good if it is impossible to choose three distinct indices i , j , k such that the points (b_i, i) , (b_j, j) and (b_k, k) form a bad triple. You are given an array a_1, a_2, ... , a_n . Calculate the number of good subarrays of a . A subarray of the array a is the array a_l, a_{l + 1}, ... , a_r for some 1 <= l <= r <= n . Note that, according to the definition, subarrays of length 1 and 2 are good. The first line contains one integer t ( 1 <= t <= 5000 ) -- the number of test cases. The first line of each test case contains one integer n ( 1 <= n <= 2 cdot 10^5 ) -- the length of array a . The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^9 ). It's guaranteed that the sum of n doesn't exceed 2 cdot 10^5 . For each test case, print the number of good subarrays of array a . In the first test case, it can be proven that any subarray of a is good. For example, subarray [a_2, a_3, a_4] is good since it contains only three elements and: In the second test case, for example, subarray [a_1, a_2, a_3, a_4] is not good, since it contains a bad triple (a_1, 1) , (a_2, 2) , (a_4, 4) : So, d((a_1, 1), (a_4, 4)) = d((a_1, 1), (a_2, 2)) + d((a_2, 2), (a_4, 4)) . "... |
Educational Codeforces Round 111 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
122506165 | ssvb | C | July 14, 2021, 4:28 p.m. | OK | D | TESTS | 5 | 77 | 18227200 | ||
122513513 | eastnman | C | July 14, 2021, 5:13 p.m. | OK | Delphi | TESTS | 5 | 77 | 6041600 | ||
122513353 | eastnman | C | July 14, 2021, 5:12 p.m. | OK | Delphi | TESTS | 5 | 77 | 6041600 | ||
122513586 | eastnman | C | July 14, 2021, 5:14 p.m. | OK | Delphi | TESTS | 5 | 249 | 6041600 | ||
122499452 | Horrigue_JyowYang | C | July 14, 2021, 4:05 p.m. | OK | GNU C++11 | TESTS | 5 | 15 | 4710400 | ||
122552441 | sea-salt | C | July 15, 2021, 5:59 a.m. | OK | GNU C++11 | TESTS | 5 | 15 | 5120000 | ||
122540370 | wut_Aware | C | July 15, 2021, 2:49 a.m. | OK | GNU C++11 | TESTS | 5 | 15 | 5529600 | ||
122549773 | wkywky | C | July 15, 2021, 5:25 a.m. | OK | GNU C++11 | TESTS | 5 | 30 | 4710400 | ||
122499773 | gaoxiangyi | C | July 14, 2021, 4:06 p.m. | OK | GNU C++11 | TESTS | 5 | 30 | 4710400 | ||
122533699 | locsey | C | July 15, 2021, 12:05 a.m. | OK | GNU C++11 | TESTS | 5 | 30 | 4710400 | ||
122535247 | greysheep | C | July 15, 2021, 12:56 a.m. | OK | GNU C++11 | TESTS | 5 | 30 | 4710400 | ||
122511397 | et3_tsy3.0 | C | July 14, 2021, 4:54 p.m. | OK | GNU C++11 | TESTS | 5 | 30 | 7065600 | ||
122504111 | Blore | C | July 14, 2021, 4:21 p.m. | OK | GNU C++11 | TESTS | 5 | 31 | 4505600 | ||
122542148 | Genius_dream | C | July 15, 2021, 3:20 a.m. | OK | GNU C++11 | TESTS | 5 | 31 | 4710400 | ||
122499529 | jinthorson | C | July 14, 2021, 4:05 p.m. | OK | GNU C++14 | TESTS | 5 | 46 | 4505600 | ||
122531536 | implementationforces | C | July 14, 2021, 10:37 p.m. | OK | GNU C++14 | TESTS | 5 | 61 | 4505600 | ||
122506583 | Satyadev | C | July 14, 2021, 4:29 p.m. | OK | GNU C++14 | TESTS | 5 | 61 | 4505600 | ||
122513705 | mythlee | C | July 14, 2021, 5:15 p.m. | OK | GNU C++14 | TESTS | 5 | 61 | 4505600 | ||
122548140 | mahir_314 | C | July 15, 2021, 5:01 a.m. | OK | GNU C++14 | TESTS | 5 | 61 | 4505600 | ||
122517525 | alwerty | C | July 14, 2021, 5:59 p.m. | OK | GNU C++14 | TESTS | 5 | 61 | 4505600 | ||
122499594 | ScottChou | C | July 14, 2021, 4:06 p.m. | OK | GNU C++14 | TESTS | 5 | 61 | 4710400 | ||
122530374 | azam5732 | C | July 14, 2021, 9:55 p.m. | OK | GNU C++14 | TESTS | 5 | 61 | 5324800 | ||
122549406 | m_srt | C | July 15, 2021, 5:20 a.m. | OK | GNU C++14 | TESTS | 5 | 61 | 5324800 | ||
122542144 | DAT_BOI | C | July 15, 2021, 3:20 a.m. | OK | GNU C++14 | TESTS | 5 | 61 | 5324800 | ||
122544584 | DSair | C | July 15, 2021, 4:04 a.m. | OK | GNU C++17 | TESTS | 5 | 15 | 5017600 | ||
122545784 | IRON_Song | C | July 15, 2021, 4:25 a.m. | OK | GNU C++17 | TESTS | 5 | 46 | 4505600 | ||
122511246 | Dungtd1304 | C | July 14, 2021, 4:53 p.m. | OK | GNU C++17 | TESTS | 5 | 46 | 4505600 | ||
122505754 | rnitish_code | C | July 14, 2021, 4:27 p.m. | OK | GNU C++17 | TESTS | 5 | 46 | 4505600 | ||
122548904 | fork52 | C | July 15, 2021, 5:13 a.m. | OK | GNU C++17 | TESTS | 5 | 46 | 5324800 | ||
122527915 | tphung21 | C | July 14, 2021, 8:48 p.m. | OK | GNU C++17 | TESTS | 5 | 46 | 5324800 | ||
122540232 | fortnite | C | July 15, 2021, 2:47 a.m. | OK | GNU C++17 | TESTS | 5 | 61 | 4505600 | ||
122544566 | Nuist_vida | C | July 15, 2021, 4:03 a.m. | OK | GNU C++17 | TESTS | 5 | 61 | 4505600 | ||
122544373 | liaoshixing | C | July 15, 2021, 4 a.m. | OK | GNU C++17 | TESTS | 5 | 61 | 4505600 | ||
122550525 | error_0000 | C | July 15, 2021, 5:34 a.m. | OK | GNU C++17 | TESTS | 5 | 61 | 4505600 | ||
122511927 | abhishek855 | C | July 14, 2021, 4:59 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 31 | 5120000 | ||
122503523 | Jackcao | C | July 14, 2021, 4:19 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 31 | 5939200 | ||
122522290 | binary1011 | C | July 14, 2021, 7:03 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 46 | 5120000 | ||
122518688 | Ripiaun | C | July 14, 2021, 6:13 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 46 | 5120000 | ||
122545610 | rgnerdplayer | C | July 15, 2021, 4:22 a.m. | OK | GNU C++17 (64) | TESTS | 5 | 46 | 5120000 | ||
122545426 | tanmay.raj.29 | C | July 15, 2021, 4:18 a.m. | OK | GNU C++17 (64) | TESTS | 5 | 46 | 5120000 | ||
122541557 | udon1206 | C | July 15, 2021, 3:11 a.m. | OK | GNU C++17 (64) | TESTS | 5 | 46 | 5120000 | ||
122535629 | InFaNg | C | July 15, 2021, 1:07 a.m. | OK | GNU C++17 (64) | TESTS | 5 | 46 | 5120000 | ||
122534733 | Ezreal_Yz | C | July 15, 2021, 12:40 a.m. | OK | GNU C++17 (64) | TESTS | 5 | 46 | 5120000 | ||
122520105 | dimasidorenko | C | July 14, 2021, 6:31 p.m. | OK | GNU C++17 (64) | TESTS | 5 | 46 | 5120000 | ||
122543277 | 0x3F | C | July 15, 2021, 3:40 a.m. | OK | Go | TESTS | 5 | 156 | 15257600 | ||
122526446 | meooow | C | July 14, 2021, 8:18 p.m. | OK | Haskell | TESTS | 5 | 655 | 54681600 | ||
122540456 | tranquyetthang281 | C | July 15, 2021, 2:51 a.m. | OK | Haskell | TESTS | 5 | 982 | 63078400 | ||
122512325 | _Body | C | July 14, 2021, 5:02 p.m. | OK | Java 11 | TESTS | 5 | 171 | 23859200 | ||
122512215 | _Body | C | July 14, 2021, 5:01 p.m. | OK | Java 11 | TESTS | 5 | 187 | 23859200 | ||
122512276 | _Body | C | July 14, 2021, 5:02 p.m. | OK | Java 11 | TESTS | 5 | 187 | 23859200 | ||
122552344 | SaberXpro | C | July 15, 2021, 5:58 a.m. | OK | Java 11 | TESTS | 5 | 202 | 23859200 | ||
122502435 | hyeok2044 | C | July 14, 2021, 4:15 p.m. | OK | Java 11 | TESTS | 5 | 202 | 23859200 | ||
122546573 | nitin23329 | C | July 15, 2021, 4:38 a.m. | OK | Java 11 | TESTS | 5 | 202 | 24064000 | ||
122510399 | GennadyTran | C | July 14, 2021, 4:46 p.m. | OK | Java 11 | TESTS | 5 | 217 | 23859200 | ||
122504825 | Tolob | C | July 14, 2021, 4:24 p.m. | OK | Java 11 | TESTS | 5 | 217 | 23859200 | ||
122522317 | qwerty12345qwerty | C | July 14, 2021, 7:03 p.m. | OK | Java 11 | TESTS | 5 | 218 | 23756800 | ||
122510127 | LiandrysAnguish | C | July 14, 2021, 4:45 p.m. | OK | Java 11 | TESTS | 5 | 218 | 23756800 | ||
122510883 | guru1603 | C | July 14, 2021, 4:50 p.m. | OK | Java 8 | TESTS | 5 | 124 | 24678400 | ||
122530492 | NerfThis | C | July 14, 2021, 9:59 p.m. | OK | Java 8 | TESTS | 5 | 124 | 24678400 | ||
122500110 | GoldenShadow | C | July 14, 2021, 4:07 p.m. | OK | Java 8 | TESTS | 5 | 139 | 22528000 | ||
122515509 | ChiMasterBing | C | July 14, 2021, 5:34 p.m. | OK | Java 8 | TESTS | 5 | 139 | 24678400 | ||
122511523 | kkkkush | C | July 14, 2021, 4:55 p.m. | OK | Java 8 | TESTS | 5 | 140 | 25907200 | ||
122517508 | devilthecoder | C | July 14, 2021, 5:58 p.m. | OK | Java 8 | TESTS | 5 | 155 | 20480000 | ||
122545425 | gdkkx | C | July 15, 2021, 4:18 a.m. | OK | Java 8 | TESTS | 5 | 155 | 24678400 | ||
122530825 | love1024 | C | July 14, 2021, 10:11 p.m. | OK | Java 8 | TESTS | 5 | 155 | 24678400 | ||
122531022 | invincible777 | C | July 14, 2021, 10:17 p.m. | OK | Java 8 | TESTS | 5 | 155 | 24780800 | ||
122527735 | themadknight45 | C | July 14, 2021, 8:45 p.m. | OK | Java 8 | TESTS | 5 | 155 | 25804800 | ||
122529675 | tdpencil | C | July 14, 2021, 9:34 p.m. | OK | Kotlin | TESTS | 5 | 249 | 36454400 | ||
122512797 | rabbitsthecat | C | July 14, 2021, 5:07 p.m. | OK | Kotlin | TESTS | 5 | 280 | 37478400 | ||
122522877 | codersanjeev | C | July 14, 2021, 7:13 p.m. | OK | Kotlin | TESTS | 5 | 295 | 36454400 | ||
122535851 | js1915wzh | C | July 15, 2021, 1:13 a.m. | OK | MS C++ | TESTS | 5 | 186 | 4710400 | ||
122545118 | yyeshell | C | July 15, 2021, 4:13 a.m. | OK | MS C++ | TESTS | 5 | 389 | 5529600 | ||
122500518 | DoubleQ666 | C | July 14, 2021, 4:09 p.m. | OK | MS C++ 2017 | TESTS | 5 | 62 | 4505600 | ||
122508779 | dingzhao777 | C | July 14, 2021, 4:36 p.m. | OK | MS C++ 2017 | TESTS | 5 | 62 | 4505600 | ||
122540917 | Ir0nic_Joker | C | July 15, 2021, 2:59 a.m. | OK | MS C++ 2017 | TESTS | 5 | 77 | 4505600 | ||
122535273 | zhangpangpang | C | July 15, 2021, 12:57 a.m. | OK | MS C++ 2017 | TESTS | 5 | 77 | 4505600 | ||
122507751 | lrb666 | C | July 14, 2021, 4:33 p.m. | OK | MS C++ 2017 | TESTS | 5 | 78 | 5324800 | ||
122507917 | FLself | C | July 14, 2021, 4:33 p.m. | OK | MS C++ 2017 | TESTS | 5 | 93 | 4505600 | ||
122515497 | swz | C | July 14, 2021, 5:34 p.m. | OK | MS C++ 2017 | TESTS | 5 | 171 | 4505600 | ||
122502655 | DingIt | C | July 14, 2021, 4:16 p.m. | OK | MS C++ 2017 | TESTS | 5 | 202 | 5324800 | ||
122506403 | sendol | C | July 14, 2021, 4:29 p.m. | OK | MS C++ 2017 | TESTS | 5 | 202 | 5324800 | ||
122545650 | LampIsVegetable | C | July 15, 2021, 4:22 a.m. | OK | MS C++ 2017 | TESTS | 5 | 218 | 4505600 | ||
122524144 | prady1100 | C | July 14, 2021, 7:35 p.m. | OK | .NET Core C# | TESTS | 5 | 140 | 26419200 | ||
122502350 | mban259 | C | July 14, 2021, 4:15 p.m. | OK | .NET Core C# | TESTS | 5 | 202 | 26624000 | ||
122501673 | bcollet | C | July 14, 2021, 4:13 p.m. | OK | PyPy 2 | TESTS | 5 | 249 | 36864000 | ||
122500342 | coden00b2021 | C | July 14, 2021, 4:08 p.m. | OK | PyPy 2 | TESTS | 5 | 249 | 38604800 | ||
122517290 | pk31299 | C | July 14, 2021, 5:56 p.m. | OK | PyPy 3 | TESTS | 5 | 217 | 37068800 | ||
122545524 | hxu10 | C | July 15, 2021, 4:20 a.m. | OK | PyPy 3 | TESTS | 5 | 218 | 37171200 | ||
122516752 | nitish420 | C | July 14, 2021, 5:49 p.m. | OK | PyPy 3 | TESTS | 5 | 233 | 37171200 | ||
122512334 | four2zero | C | July 14, 2021, 5:02 p.m. | OK | PyPy 3 | TESTS | 5 | 233 | 37171200 | ||
122503337 | skhan_org | C | July 14, 2021, 4:18 p.m. | OK | PyPy 3 | TESTS | 5 | 249 | 36966400 | ||
122551173 | 6-_-9 | C | July 15, 2021, 5:43 a.m. | OK | PyPy 3 | TESTS | 5 | 264 | 37683200 | ||
122530053 | yash490 | C | July 14, 2021, 9:45 p.m. | OK | PyPy 3 | TESTS | 5 | 280 | 37683200 | ||
122512372 | srijan.sarkar | C | July 14, 2021, 5:03 p.m. | OK | PyPy 3 | TESTS | 5 | 311 | 36249600 | ||
122514394 | armsusman | C | July 14, 2021, 5:22 p.m. | OK | PyPy 3 | TESTS | 5 | 312 | 40960000 | ||
122518236 | bjy | C | July 14, 2021, 6:08 p.m. | OK | PyPy 3 | TESTS | 5 | 342 | 37888000 | ||
122515877 | Hitik | C | July 14, 2021, 5:38 p.m. | OK | Python 2 | TESTS | 5 | 889 | 17612800 | ||
122502894 | peakypo | C | July 14, 2021, 4:17 p.m. | OK | Python 3 | TESTS | 5 | 358 | 24064000 | ||
122517897 | gautham227 | C | July 14, 2021, 6:03 p.m. | OK | Python 3 | TESTS | 5 | 389 | 21606400 | ||
122515196 | aranjan1 | C | July 14, 2021, 5:31 p.m. | OK | Python 3 | TESTS | 5 | 405 | 22118400 | ||
122514046 | aranjan1 | C | July 14, 2021, 5:19 p.m. | OK | Python 3 | TESTS | 5 | 420 | 21913600 | ||
122539817 | mkawa2 | C | July 15, 2021, 2:39 a.m. | OK | Python 3 | TESTS | 5 | 436 | 21606400 | ||
122515936 | MattMcGuire | C | July 14, 2021, 5:39 p.m. | OK | Python 3 | TESTS | 5 | 483 | 21606400 | ||
122503585 | vinay272001 | C | July 14, 2021, 4:19 p.m. | OK | Python 3 | TESTS | 5 | 483 | 21606400 | ||
122542282 | DK_here | C | July 15, 2021, 3:22 a.m. | OK | Python 3 | TESTS | 5 | 499 | 21606400 | ||
122526476 | nk92292 | C | July 14, 2021, 8:19 p.m. | OK | Python 3 | TESTS | 5 | 514 | 21913600 | ||
122538811 | HimanShu09 | C | July 15, 2021, 2:19 a.m. | OK | Python 3 | TESTS | 5 | 530 | 21606400 | ||
122520120 | professor-flux | C | July 14, 2021, 6:32 p.m. | OK | Rust | TESTS | 5 | 31 | 6963200 | ||
122500951 | Hillmouse | C | July 14, 2021, 4:10 p.m. | OK | Rust | TESTS | 5 | 31 | 7987200 | ||
122501094 | GraphTheory | C | July 14, 2021, 4:11 p.m. | OK | Rust | TESTS | 5 | 61 | 10854400 |
Back to search problems