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"In this problem MEX of a certain array is the smallest positive integer not contained in this array. Everyone knows this definition, including Lesha. But Lesha loves MEX, so he comes up with a new problem involving MEX every day, including today. You are given an array a of length n . Lesha considers all the non-empty subarrays of the initial array and computes MEX for each of them. Then Lesha computes MEX of the obtained numbers. An array b is a subarray of an array a , if b can be obtained from a by deletion of several (possible none or all) elements from the beginning and several (possibly none or all) elements from the end. In particular, an array is a subarray of itself. Lesha understands that the problem is very interesting this time, but he doesn't know how to solve it. Help him and find the MEX of MEXes of all the subarrays! The first line contains a single integer n ( 1 <= n <= 10^5 ) -- the length of the array. The next line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ) -- the elements of the array. Print a single integer -- the MEX of MEXes of all subarrays. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
96742580 |
sunzihao |
E |
Oct. 26, 2020, 3:22 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
31 |
1740800 |
|
|
96738705 |
aa___ |
E |
Oct. 26, 2020, 1:28 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
46 |
1536000 |
|
|
96742557 |
sunzihao |
E |
Oct. 26, 2020, 3:21 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
46 |
1740800 |
|
|
96738402 |
Youth518 |
E |
Oct. 26, 2020, 1:20 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
46 |
1740800 |
|
|
96636656 |
hht2005 |
E |
Oct. 25, 2020, 8:22 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
46 |
2048000 |
|
|
96647343 |
Intro. |
E |
Oct. 25, 2020, 10:49 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
46 |
2048000 |
|
|
96741645 |
fr200110217102 |
E |
Oct. 26, 2020, 2:57 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
46 |
2560000 |
|
|
96639868 |
Lu_Anlai |
E |
Oct. 25, 2020, 9:04 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
46 |
2662400 |
|
|
96624027 |
sher_wu |
E |
Oct. 25, 2020, 3:36 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
46 |
2867200 |
|
|
96640251 |
liangziqi |
E |
Oct. 25, 2020, 9:09 a.m. |
OK |
GNU C++11 |
TESTS |
109 |
46 |
3174400 |
|
|
96658018 |
FKint |
E |
Oct. 25, 2020, 11:22 a.m. |
OK |
GNU C++14 |
TESTS |
109 |
46 |
1228800 |
|
|
96739413 |
4790iop |
E |
Oct. 26, 2020, 1:47 a.m. |
OK |
GNU C++14 |
TESTS |
109 |
46 |
1740800 |
|
|
96747109 |
loulingli |
E |
Oct. 26, 2020, 5:19 a.m. |
OK |
GNU C++14 |
TESTS |
109 |
46 |
3379200 |
|
|
96648033 |
yadavsa |
E |
Oct. 25, 2020, 10:59 a.m. |
OK |
GNU C++14 |
TESTS |
109 |
61 |
3891200 |
|
|
96741219 |
_Backl1ght |
E |
Oct. 26, 2020, 2:46 a.m. |
OK |
GNU C++14 |
TESTS |
109 |
61 |
7065600 |
|
|
96596965 |
clyring |
E |
Oct. 24, 2020, 5:45 p.m. |
OK |
GNU C++14 |
TESTS |
107 |
62 |
921600 |
|
|
96613496 |
Cyprien |
E |
Oct. 24, 2020, 8:54 p.m. |
OK |
GNU C++14 |
TESTS |
109 |
62 |
1638400 |
|
|
96739739 |
4790iop |
E |
Oct. 26, 2020, 1:58 a.m. |
OK |
GNU C++14 |
TESTS |
109 |
62 |
1740800 |
|
|
96632795 |
sharabhagrawal25 |
E |
Oct. 25, 2020, 7:24 a.m. |
OK |
GNU C++14 |
TESTS |
109 |
62 |
2560000 |
|
|
96648076 |
yadavsa |
E |
Oct. 25, 2020, 10:59 a.m. |
OK |
GNU C++14 |
TESTS |
109 |
62 |
3993600 |
|
|
96720001 |
Thallium_is_Vegetable |
E |
Oct. 25, 2020, 5:27 p.m. |
OK |
GNU C++17 |
TESTS |
109 |
61 |
1638400 |
|
|
96618978 |
mafailure |
E |
Oct. 25, 2020, midnight |
OK |
GNU C++17 |
TESTS |
109 |
61 |
1638400 |
|
|
96746636 |
huanggs |
E |
Oct. 26, 2020, 5:09 a.m. |
OK |
GNU C++17 |
TESTS |
109 |
61 |
1638400 |
|
|
96601578 |
LeoRiether |
E |
Oct. 24, 2020, 6:09 p.m. |
OK |
GNU C++17 |
TESTS |
107 |
62 |
1740800 |
|
|
96610349 |
Tiagodfs |
E |
Oct. 24, 2020, 7:53 p.m. |
OK |
GNU C++17 |
TESTS |
108 |
62 |
1843200 |
|
|
96713250 |
Gajowy |
E |
Oct. 25, 2020, 3:49 p.m. |
OK |
GNU C++17 |
TESTS |
109 |
62 |
1843200 |
|
|
96728104 |
HanaYukii |
E |
Oct. 25, 2020, 7:50 p.m. |
OK |
GNU C++17 |
TESTS |
109 |
62 |
2048000 |
|
|
96640521 |
PoPk1u |
E |
Oct. 25, 2020, 9:13 a.m. |
OK |
GNU C++17 |
TESTS |
109 |
62 |
2457600 |
|
|
96744458 |
wisest |
E |
Oct. 26, 2020, 4:17 a.m. |
OK |
GNU C++17 |
TESTS |
109 |
62 |
2560000 |
|
|
96644548 |
Tanmay_21 |
E |
Oct. 25, 2020, 10:10 a.m. |
OK |
GNU C++17 |
TESTS |
109 |
62 |
3276800 |
|
|
96599029 |
hat |
E |
Oct. 24, 2020, 5:56 p.m. |
OK |
GNU C++17 (64) |
TESTS |
107 |
46 |
1638400 |
|
|
96717481 |
hat |
E |
Oct. 25, 2020, 4:47 p.m. |
OK |
GNU C++17 (64) |
TESTS |
109 |
46 |
1740800 |
|
|
96620687 |
wlzhouzhuan |
E |
Oct. 25, 2020, 1:20 a.m. |
OK |
GNU C++17 (64) |
TESTS |
109 |
46 |
2252800 |
|
|
96611738 |
PurpleCrayon |
E |
Oct. 24, 2020, 8:18 p.m. |
OK |
GNU C++17 (64) |
TESTS |
109 |
46 |
2252800 |
|
|
96620712 |
wlzhouzhuan |
E |
Oct. 25, 2020, 1:21 a.m. |
OK |
GNU C++17 (64) |
TESTS |
109 |
46 |
2252800 |
|
|
96618213 |
xennygrimmato |
E |
Oct. 24, 2020, 11:22 p.m. |
OK |
GNU C++17 (64) |
TESTS |
109 |
46 |
4096000 |
|
|
96618175 |
xennygrimmato |
E |
Oct. 24, 2020, 11:21 p.m. |
OK |
GNU C++17 (64) |
TESTS |
109 |
46 |
4096000 |
|
|
96618380 |
xennygrimmato |
E |
Oct. 24, 2020, 11:29 p.m. |
OK |
GNU C++17 (64) |
TESTS |
109 |
46 |
4096000 |
|
|
96618241 |
xennygrimmato |
E |
Oct. 24, 2020, 11:23 p.m. |
OK |
GNU C++17 (64) |
TESTS |
109 |
46 |
4096000 |
|
|
96607110 |
CoderAnshu |
E |
Oct. 24, 2020, 7 p.m. |
OK |
GNU C++17 (64) |
TESTS |
107 |
46 |
4915200 |
|
|
96626304 |
skittles1412 |
E |
Oct. 25, 2020, 5:18 a.m. |
OK |
Java 11 |
TESTS |
109 |
295 |
20172800 |
|
|
96618532 |
Agnimandur |
E |
Oct. 24, 2020, 11:36 p.m. |
OK |
Java 11 |
TESTS |
109 |
467 |
7065600 |
|
|
96634473 |
StayAwayFromBitches |
E |
Oct. 25, 2020, 7:48 a.m. |
OK |
Java 8 |
TESTS |
109 |
140 |
9318400 |
|
|
96620827 |
adp527 |
E |
Oct. 25, 2020, 1:25 a.m. |
OK |
Java 8 |
TESTS |
109 |
171 |
1843200 |
|
|
96732894 |
Slamur |
E |
Oct. 25, 2020, 10:02 p.m. |
OK |
Java 8 |
TESTS |
109 |
265 |
0 |
|
|
96641271 |
Taran_1407 |
E |
Oct. 25, 2020, 9:23 a.m. |
OK |
Java 8 |
TESTS |
109 |
280 |
13209600 |
|
|
96641777 |
Taran_1407 |
E |
Oct. 25, 2020, 9:30 a.m. |
OK |
Java 8 |
TESTS |
109 |
280 |
13824000 |
|
|
96736344 |
robinz62 |
E |
Oct. 25, 2020, 11:55 p.m. |
OK |
Java 8 |
TESTS |
109 |
327 |
32870400 |
|
|
96639525 |
Katushechka |
E |
Oct. 25, 2020, 8:59 a.m. |
OK |
Java 8 |
TESTS |
109 |
389 |
6041600 |
|
|
96606312 |
martins |
E |
Oct. 24, 2020, 6:50 p.m. |
OK |
Java 8 |
TESTS |
107 |
530 |
178483200 |
|
|
96722276 |
ijxjdjd |
E |
Oct. 25, 2020, 6:06 p.m. |
OK |
Java 8 |
TESTS |
109 |
546 |
27238400 |
|
|
96603981 |
rk42745417 |
E |
Oct. 24, 2020, 6:23 p.m. |
OK |
Kotlin |
TESTS |
107 |
343 |
17408000 |
|
|
96704641 |
sid9406 |
E |
Oct. 25, 2020, 2:04 p.m. |
OK |
Kotlin |
TESTS |
109 |
561 |
33587200 |
|
|
96632173 |
17658592801 |
E |
Oct. 25, 2020, 7:11 a.m. |
OK |
MS C++ 2017 |
TESTS |
109 |
233 |
18944000 |
|
|
96597015 |
EmK |
E |
Oct. 24, 2020, 5:45 p.m. |
OK |
.NET Core C# |
TESTS |
107 |
124 |
4300800 |
|
|
96624472 |
azukun |
E |
Oct. 25, 2020, 3:58 a.m. |
OK |
.NET Core C# |
TESTS |
109 |
233 |
11468800 |
|
|
96609157 |
sh1194 |
E |
Oct. 24, 2020, 7:32 p.m. |
OK |
PyPy 3 |
TESTS |
107 |
608 |
27648000 |
|
|
96601368 |
nwi |
E |
Oct. 24, 2020, 6:07 p.m. |
OK |
Python 2 |
TESTS |
107 |
982 |
5427200 |
|
|
96599970 |
nwi |
E |
Oct. 24, 2020, 6:03 p.m. |
OK |
Python 2 |
TESTS |
107 |
998 |
5427200 |
|
|
96605778 |
tuna_salad |
E |
Oct. 24, 2020, 6:43 p.m. |
OK |
Rust |
TESTS |
107 |
218 |
59289600 |
|
|
remove filters
Back to search problems