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 |
---|---|---|---|---|---|---|
997 | Codeforces Round 493 (Div. 1) | FINISHED | False | 7200 | 207071723 | July 1, 2018, 2:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1349 ) | E | Good Subsegments | PROGRAMMING | data structures | 3000 |
B"A permutation p of length n is a sequence p_1, p_2, ldots, p_n consisting of n distinct integers, each of which from 1 to n ( 1 <= q p_i <= q n ) . Let's call the subsegment [l,r] of the permutation good if all numbers from the minimum on it to the maximum on this subsegment occur among the numbers p_l, p_{l+1}, ... , p_r . For example, good segments of permutation [1, 3, 2, 5, 4] are: You are given a permutation p_1, p_2, ldots, p_n . You need to answer q queries of the form: find the number of good subsegments of the given segment of permutation. In other words, to answer one query, you need to calculate the number of good subsegments [x ... y] for some given segment [l ... r] , such that l <= q x <= q y <= q r . The first line contains a single integer n ( 1 <= q n <= q 120000 ) -- the number of elements in the permutation. The second line contains n distinct integers p_1, p_2, ldots, p_n separated by spaces ( 1 <= q p_i <= q n ). The third line contains an integer q ( 1 <= q q <= q 120000 ) -- number of queries. The following q lines describe queries, each line contains a pair of integers l , r separated by space ( 1 <= q l <= q r <= q n ). Print a q lines, i -th of them should contain a number of good subsegments of a segment, given in the i -th query. "... |
60357 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
40931725 | ReaLNero1 | E | July 30, 2018, 1:16 a.m. | OK | GNU C++ | TESTS | 88 | 217 | 15462400 | 3000 | |
40520275 | Wuweizheng | E | July 18, 2018, 3:43 p.m. | OK | GNU C++ | TESTS | 88 | 217 | 15462400 | 3000 | |
40402325 | luogu_bot4 | E | July 16, 2018, 8:11 a.m. | OK | GNU C++ | TESTS | 88 | 233 | 15462400 | 3000 | |
40402455 | luogu_bot1 | E | July 16, 2018, 8:14 a.m. | OK | GNU C++ | TESTS | 88 | 234 | 15360000 | 3000 | |
40014718 | hzq84621 | E | July 6, 2018, 12:41 a.m. | OK | GNU C++ | TESTS | 88 | 249 | 15667200 | 3000 | |
40827197 | fwat | E | July 27, 2018, 3:44 a.m. | OK | GNU C++ | TESTS | 88 | 264 | 18124800 | 3000 | |
39987000 | litble | E | July 5, 2018, 2:19 p.m. | OK | GNU C++ | TESTS | 88 | 265 | 15360000 | 3000 | |
39951278 | robinliu | E | July 4, 2018, 10:27 a.m. | OK | GNU C++ | TESTS | 88 | 265 | 17510400 | 3000 | |
41882553 | fwat | E | Aug. 20, 2018, 2:11 a.m. | OK | GNU C++ | TESTS | 88 | 265 | 18124800 | 3000 | |
41240261 | mayaohua2003 | E | Aug. 5, 2018, 9:46 a.m. | OK | GNU C++ | TESTS | 88 | 311 | 20684800 | 3000 | |
58526385 | Peanut.Tang | E | Aug. 10, 2019, 7:19 a.m. | OK | GNU C++11 | TESTS | 88 | 155 | 27852800 | 3000 | |
58522580 | __guess | E | Aug. 10, 2019, 5:40 a.m. | OK | GNU C++11 | TESTS | 88 | 156 | 27852800 | 3000 | |
48454365 | hyzxzcy | E | Jan. 16, 2019, 12:03 p.m. | OK | GNU C++11 | TESTS | 88 | 156 | 29286400 | 3000 | |
64073071 | Rockyyh | E | Nov. 2, 2019, 8:03 a.m. | OK | GNU C++11 | TESTS | 88 | 156 | 65433600 | 3000 | |
57716876 | tyler178 | E | July 25, 2019, 3:07 a.m. | OK | GNU C++11 | TESTS | 88 | 171 | 18022400 | 3000 | |
60424756 | dqa2020 | E | Sept. 12, 2019, 7:35 a.m. | OK | GNU C++11 | TESTS | 88 | 171 | 19558400 | 3000 | |
67065497 | yinghua1314 | E | Dec. 17, 2019, 10:56 a.m. | OK | GNU C++11 | TESTS | 88 | 171 | 25292800 | 3000 | |
60465937 | lzoilxy | E | Sept. 13, 2019, 1:35 a.m. | OK | GNU C++11 | TESTS | 88 | 171 | 25600000 | 3000 | |
49753264 | 142857 | E | Feb. 11, 2019, 4:28 a.m. | OK | GNU C++11 | TESTS | 88 | 171 | 46080000 | 3000 | |
63929009 | Fisher_Man | E | Oct. 31, 2019, 1:47 p.m. | OK | GNU C++11 | TESTS | 88 | 171 | 64102400 | 3000 | |
46406652 | Mlxa | E | Nov. 30, 2018, 2:57 p.m. | OK | GNU C++14 | TESTS | 88 | 140 | 80588800 | 3000 | |
60291409 | idxcalcal | E | Sept. 9, 2019, 7:27 a.m. | OK | GNU C++14 | TESTS | 88 | 155 | 20275200 | 3000 | |
44177790 | lunch | E | Oct. 12, 2018, 9:42 a.m. | OK | GNU C++14 | TESTS | 88 | 187 | 28364800 | 3000 | |
44176538 | lunch | E | Oct. 12, 2018, 9:09 a.m. | OK | GNU C++14 | TESTS | 88 | 202 | 28364800 | 3000 | |
46942045 | Mlxa | E | Dec. 12, 2018, 5:14 p.m. | OK | GNU C++14 | TESTS | 88 | 218 | 18022400 | 3000 | |
46942039 | Mlxa | E | Dec. 12, 2018, 5:14 p.m. | OK | GNU C++14 | TESTS | 88 | 218 | 18022400 | 3000 | |
46942029 | Mlxa | E | Dec. 12, 2018, 5:14 p.m. | OK | GNU C++14 | TESTS | 88 | 218 | 18022400 | 3000 | |
46850054 | Mlxa | E | Dec. 10, 2018, 11:48 a.m. | OK | GNU C++14 | TESTS | 88 | 218 | 18022400 | 3000 | |
46649023 | Mlxa | E | Dec. 5, 2018, 1:08 p.m. | OK | GNU C++14 | TESTS | 88 | 218 | 18022400 | 3000 | |
46403442 | Mlxa | E | Nov. 30, 2018, 1:24 p.m. | OK | GNU C++14 | TESTS | 88 | 218 | 18022400 | 3000 | |
45901162 | FizzyDavid | E | Nov. 18, 2018, 4:56 a.m. | OK | GNU C++17 | TESTS | 88 | 202 | 62566400 | 3000 | |
57892117 | nickluo | E | July 28, 2019, 12:12 p.m. | OK | GNU C++17 | TESTS | 88 | 233 | 21913600 | 3000 | |
57893342 | nickluo | E | July 28, 2019, 12:37 p.m. | OK | GNU C++17 | TESTS | 88 | 249 | 21913600 | 3000 | |
66618014 | Lrztxdy | E | Dec. 11, 2019, 5:30 a.m. | OK | GNU C++17 | TESTS | 88 | 264 | 25702400 | 3000 | |
40712429 | Twishkle.Aevdark | E | July 24, 2018, 4:54 p.m. | OK | GNU C++17 | TESTS | 88 | 265 | 18022400 | 3000 | |
63250974 | gxucm | E | Oct. 23, 2019, 4:03 p.m. | OK | GNU C++17 | TESTS | 88 | 280 | 15360000 | 3000 | |
64059171 | Romeolong | E | Nov. 2, 2019, 2:59 a.m. | OK | GNU C++17 | TESTS | 88 | 295 | 75161600 | 3000 | |
47488284 | flukehn | E | Dec. 25, 2018, 10:22 a.m. | OK | GNU C++17 | TESTS | 88 | 311 | 17305600 | 3000 | |
40402441 | 201781 | E | July 16, 2018, 8:14 a.m. | OK | GNU C++17 | TESTS | 88 | 312 | 15360000 | 3000 | |
40368206 | 201781 | E | July 15, 2018, 6:57 a.m. | OK | GNU C++17 | TESTS | 88 | 312 | 15360000 | 3000 | |
69250443 | vjudge1 | E | Jan. 21, 2020, 2:06 p.m. | OK | MS C++ | TESTS | 88 | 358 | 50892800 | 3000 |
Back to search problems