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.
Problems
B"You are given a permutation p of n integers 1 , 2 , ..., n (a permutation is an array where each element from 1 to n occurs exactly once). Let's call some subsegment p[l, r] of this permutation special if p_l + p_r = max limits_{i = l}^{r} p_i . Please calculate the number of special subsegments. The first line contains one integer n ( 3 <= n <= 2 cdot 10^5 ). The second line contains n integers p_1 , p_2 , ..., p_n ( 1 <= p_i <= n ). All these integers are pairwise distinct. Print the number of special subsegments of the given permutation. Special subsegments in the first example are [1, 5] and [1, 3] . The only special subsegment in the second example is [1, 3] . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
53738167 |
muleax |
E |
May 4, 2019, 12:10 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
20 |
982 |
3276800 |
|
2400 |
53696285 |
hack1nt0 |
E |
May 3, 2019, 7:55 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
20 |
1044 |
3276800 |
|
2400 |
53675999 |
Denor |
E |
May 2, 2019, 3:53 p.m. |
OK |
Delphi |
TESTS |
20 |
93 |
8601600 |
|
2400 |
55140429 |
sansen |
E |
June 5, 2019, 2:59 p.m. |
OK |
GNU C11 |
TESTS |
20 |
61 |
24371200 |
|
2400 |
55212342 |
rainboy |
E |
June 6, 2019, 3:09 p.m. |
OK |
GNU C11 |
TESTS |
20 |
62 |
3379200 |
|
2400 |
53673127 |
sash0 |
E |
May 2, 2019, 2:16 p.m. |
OK |
GNU C11 |
TESTS |
20 |
62 |
3993600 |
|
2400 |
55170378 |
sansen |
E |
June 5, 2019, 4:50 p.m. |
OK |
GNU C11 |
TESTS |
20 |
62 |
27648000 |
|
2400 |
53883956 |
Noetu |
E |
May 8, 2019, 4:43 p.m. |
OK |
GNU C11 |
TESTS |
20 |
124 |
32051200 |
|
2400 |
53862082 |
about |
E |
May 7, 2019, 9:57 p.m. |
OK |
GNU C11 |
TESTS |
20 |
234 |
9830400 |
|
2400 |
53773477 |
EncodeTalker |
E |
May 5, 2019, 6:58 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
31 |
3276800 |
|
2400 |
64645151 |
chdyFZH |
E |
Nov. 10, 2019, 2:40 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
31 |
3993600 |
|
2400 |
53724403 |
newbiechdboom0 |
E |
May 4, 2019, 3 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
31 |
4812800 |
|
2400 |
53689630 |
Even_Bao |
E |
May 3, 2019, 3:45 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
31 |
4915200 |
|
2400 |
53689607 |
luogu_bot2 |
E |
May 3, 2019, 3:44 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
31 |
4915200 |
|
2400 |
53689225 |
__Darkmoon |
E |
May 3, 2019, 3:27 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
31 |
18432000 |
|
2400 |
63896893 |
hsm_2021 |
E |
Oct. 31, 2019, 2:39 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
31 |
20889600 |
|
2400 |
53896097 |
myx12345 |
E |
May 9, 2019, 6:03 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
31 |
22016000 |
|
2400 |
53846114 |
528hby |
E |
May 7, 2019, 11:02 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
46 |
2457600 |
|
2400 |
54385959 |
luogu_bot3 |
E |
May 19, 2019, 1:24 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
46 |
2457600 |
|
2400 |
53693698 |
xyw5vplus1 |
E |
May 3, 2019, 6:33 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
62 |
3993600 |
|
2400 |
58348186 |
NDKhoa |
E |
Aug. 5, 2019, 3:58 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
62 |
4198400 |
|
2400 |
55708154 |
blast |
E |
June 18, 2019, 8:48 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
62 |
4300800 |
|
2400 |
53674277 |
tin2016_ndhanh |
E |
May 2, 2019, 2:52 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
62 |
4812800 |
|
2400 |
53719735 |
lcs147 |
E |
May 3, 2019, 9:33 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
62 |
5120000 |
|
2400 |
61777719 |
vjudge3 |
E |
Oct. 3, 2019, 12:13 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
62 |
5632000 |
|
2400 |
53697156 |
ccsu_cat_love_jiejie |
E |
May 3, 2019, 8:23 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
77 |
1638400 |
|
2400 |
53701420 |
SUDAL |
E |
May 3, 2019, 10:42 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
77 |
2457600 |
|
2400 |
61093707 |
compiler_101 |
E |
Sept. 23, 2019, 12:42 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
77 |
3174400 |
|
2400 |
56075957 |
Peti |
E |
June 26, 2019, 12:50 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
77 |
3174400 |
|
2400 |
53630098 |
panoIe |
E |
May 1, 2019, 3:32 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
31 |
19046400 |
|
2400 |
53840341 |
wjfwjfwjf |
E |
May 7, 2019, 7:03 a.m. |
OK |
GNU C++17 |
TESTS |
20 |
62 |
2457600 |
|
2400 |
53660072 |
WuK |
E |
May 2, 2019, 7:13 a.m. |
OK |
GNU C++17 |
TESTS |
20 |
62 |
3174400 |
|
2400 |
53671277 |
TeeEye |
E |
May 2, 2019, 1:17 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
62 |
3174400 |
|
2400 |
53962841 |
vjudge1 |
E |
May 10, 2019, 3:09 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
62 |
3174400 |
|
2400 |
53672980 |
sash0 |
E |
May 2, 2019, 2:10 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
62 |
3993600 |
|
2400 |
53642302 |
vhnvn |
E |
May 1, 2019, 5:07 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
62 |
3993600 |
|
2400 |
58913604 |
WstOne |
E |
Aug. 16, 2019, 2:02 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
62 |
3993600 |
|
2400 |
53878121 |
mohamedeltair |
E |
May 8, 2019, 1:07 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
62 |
4198400 |
|
2400 |
53680107 |
DATVN |
E |
May 2, 2019, 6:33 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
62 |
4300800 |
|
2400 |
53945664 |
emma |
E |
May 10, 2019, 6:31 a.m. |
OK |
Go |
TESTS |
20 |
498 |
36352000 |
|
2400 |
65506524 |
bluesky111 |
E |
Nov. 21, 2019, 11:14 p.m. |
OK |
Java 11 |
TESTS |
20 |
249 |
6451200 |
|
2400 |
53702982 |
aman28rwt |
E |
May 3, 2019, 11:38 a.m. |
OK |
Java 8 |
TESTS |
20 |
139 |
0 |
|
2400 |
55212341 |
Dukkha |
E |
June 6, 2019, 3:09 p.m. |
OK |
Java 8 |
TESTS |
20 |
140 |
409600 |
|
2400 |
53630185 |
StayAwayFromBitches |
E |
May 1, 2019, 3:32 p.m. |
OK |
Java 8 |
TESTS |
20 |
140 |
11264000 |
|
2400 |
53683305 |
jenish9599 |
E |
May 2, 2019, 9:03 p.m. |
OK |
Java 8 |
TESTS |
20 |
140 |
14131200 |
|
2400 |
54995821 |
islammohsen |
E |
June 2, 2019, 11:26 p.m. |
OK |
Java 8 |
TESTS |
20 |
155 |
5939200 |
|
2400 |
53633467 |
Yugioh |
E |
May 1, 2019, 3:48 p.m. |
OK |
Java 8 |
TESTS |
20 |
155 |
20377600 |
|
2400 |
53741778 |
polyakoff |
E |
May 4, 2019, 2:16 p.m. |
OK |
Java 8 |
TESTS |
20 |
156 |
2560000 |
|
2400 |
53828744 |
4mda4mda |
E |
May 6, 2019, 6:12 p.m. |
OK |
Java 8 |
TESTS |
20 |
156 |
3481600 |
|
2400 |
54995528 |
islammohsen |
E |
June 2, 2019, 10:55 p.m. |
OK |
Java 8 |
TESTS |
20 |
156 |
5939200 |
|
2400 |
54006582 |
icpc_loser |
E |
May 11, 2019, 8:32 p.m. |
OK |
Java 8 |
TESTS |
20 |
156 |
20992000 |
|
2400 |
59911138 |
its_aks_ulure |
E |
Sept. 2, 2019, 5:17 p.m. |
OK |
Kotlin |
TESTS |
20 |
233 |
5529600 |
|
2400 |
53701055 |
omikad |
E |
May 3, 2019, 10:27 a.m. |
OK |
Mono C# |
TESTS |
20 |
108 |
20992000 |
|
2400 |
53853931 |
vjudge3 |
E |
May 7, 2019, 3 p.m. |
OK |
MS C++ |
TESTS |
20 |
62 |
3174400 |
|
2400 |
61612500 |
vjudge5 |
E |
Oct. 1, 2019, 2:32 p.m. |
OK |
MS C++ |
TESTS |
20 |
109 |
23244800 |
|
2400 |
53743515 |
vjudge4 |
E |
May 4, 2019, 3:14 p.m. |
OK |
MS C++ |
TESTS |
20 |
139 |
32051200 |
|
2400 |
53899811 |
vjudge5 |
E |
May 9, 2019, 8:27 a.m. |
OK |
MS C++ |
TESTS |
20 |
171 |
7065600 |
|
2400 |
53662330 |
SakaRenko |
E |
May 2, 2019, 8:27 a.m. |
OK |
MS C++ |
TESTS |
20 |
202 |
25600000 |
|
2400 |
54053522 |
Lordxx |
E |
May 13, 2019, 6:28 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
93 |
2457600 |
|
2400 |
53739367 |
muleax |
E |
May 4, 2019, 12:52 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
93 |
3174400 |
|
2400 |
53697422 |
AleksanderBalobanov |
E |
May 3, 2019, 8:30 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
93 |
4096000 |
|
2400 |
54063697 |
Lordxx |
E |
May 13, 2019, 12:24 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
93 |
4710400 |
|
2400 |
53713874 |
CtrlAlt |
E |
May 3, 2019, 5:30 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
93 |
5939200 |
|
2400 |
53651142 |
petko_mitkov |
E |
May 2, 2019, 1:12 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
93 |
6144000 |
|
2400 |
54054166 |
Lordxx |
E |
May 13, 2019, 6:56 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
139 |
32870400 |
|
2400 |
53738209 |
muleax |
E |
May 4, 2019, 12:12 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
187 |
3174400 |
|
2400 |
53738102 |
muleax |
E |
May 4, 2019, 12:08 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
187 |
3174400 |
|
2400 |
53739196 |
muleax |
E |
May 4, 2019, 12:47 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
187 |
3174400 |
|
2400 |
53713777 |
gatsko |
E |
May 3, 2019, 5:24 p.m. |
OK |
PyPy 2 |
TESTS |
20 |
436 |
23654400 |
|
2400 |
53641536 |
pajenegod |
E |
May 1, 2019, 4:53 p.m. |
OK |
PyPy 2 |
TESTS |
20 |
467 |
22937600 |
|
2400 |
53872262 |
FallingStar |
E |
May 8, 2019, 9:53 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
389 |
22937600 |
|
2400 |
60524208 |
achi_basadzishvili |
E |
Sept. 14, 2019, 9:41 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
795 |
52838400 |
|
2400 |
53636710 |
meooow |
E |
May 1, 2019, 4:08 p.m. |
OK |
PyPy 3 |
TESTS |
20 |
1060 |
78233600 |
|
2400 |
53637328 |
meooow |
E |
May 1, 2019, 4:13 p.m. |
OK |
PyPy 3 |
TESTS |
20 |
1075 |
69222400 |
|
2400 |
53637594 |
nwi |
E |
May 1, 2019, 4:15 p.m. |
OK |
Python 2 |
TESTS |
20 |
748 |
16588800 |
|
2400 |
53713663 |
Helli.code |
E |
May 3, 2019, 5:18 p.m. |
OK |
Python 2 |
TESTS |
20 |
1747 |
34918400 |
|
2400 |
53723162 |
joe_joe |
E |
May 4, 2019, 2:01 a.m. |
OK |
Python 3 |
TESTS |
20 |
1341 |
54476800 |
|
2400 |
53871810 |
FallingStar |
E |
May 8, 2019, 9:35 a.m. |
OK |
Python 3 |
TESTS |
20 |
1356 |
16076800 |
|
2400 |
61738395 |
abhishek.kr.met16 |
E |
Oct. 2, 2019, 7:06 p.m. |
OK |
Python 3 |
TESTS |
20 |
1388 |
14233600 |
|
2400 |
53869865 |
praveen.123 |
E |
May 8, 2019, 8:06 a.m. |
OK |
Python 3 |
TESTS |
20 |
1419 |
14643200 |
|
2400 |
55545661 |
kobae964 |
E |
June 14, 2019, 2:10 a.m. |
OK |
Rust |
TESTS |
20 |
452 |
11161600 |
|
2400 |
56761063 |
yakamoto |
E |
July 9, 2019, 3:53 p.m. |
OK |
Scala |
TESTS |
20 |
1170 |
56012800 |
|
2400 |
remove filters
Back to search problems