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'One day, BThero decided to play around with arrays and came up with the following problem: You are given an array a , which consists of n positive integers. The array is numerated 1 through n . You execute the following procedure exactly once: Find and print the minimum possible value of |b| (size of b ) which can be achieved at the end of the procedure. It can be shown that under the given constraints there is at least one way to construct b . The first line of the input file contains a single integer T ( 1 <= T <= 5 cdot 10^5 ) denoting the number of test cases. The description of T test cases follows. The first line of each test contains a single integer n ( 1 <= n <= 5 cdot 10^5 ). The second line contains n space-separated integers a_1 , a_2 , ..., a_n ( 2 <= a_i <= 10^9 ). It is guaranteed that sum{n} over all test cases does not exceed 5 cdot 10^5 . For each test case, print a single line containing one integer -- the minimum possible value of |b| . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
94038457 |
gongsuidashen |
E |
Sept. 28, 2020, 12:23 a.m. |
OK |
GNU C++11 |
TESTS |
62 |
187 |
16076800 |
|
3200 |
94041458 |
BSBandme |
E |
Sept. 28, 2020, 2:10 a.m. |
OK |
GNU C++14 |
TESTS |
62 |
1809 |
200704000 |
|
3200 |
94024936 |
tlwpdus |
E |
Sept. 27, 2020, 6:16 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
280 |
22323200 |
|
3200 |
93989598 |
tourist |
E |
Sept. 27, 2020, 3:41 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
311 |
18227200 |
|
3200 |
94018911 |
Marcin_smu |
E |
Sept. 27, 2020, 5:03 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
312 |
16281600 |
|
3200 |
94013675 |
_h_ |
E |
Sept. 27, 2020, 4:48 p.m. |
OK |
GNU C++17 |
TESTS |
62 |
326 |
20275200 |
|
3200 |
94047217 |
Nezzar |
E |
Sept. 28, 2020, 4:30 a.m. |
OK |
GNU C++17 |
TESTS |
62 |
327 |
18636800 |
|
3200 |
94005344 |
maroonrk |
E |
Sept. 27, 2020, 4:22 p.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
140 |
28262400 |
|
3200 |
94029993 |
Benq |
E |
Sept. 27, 2020, 7:40 p.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
217 |
26112000 |
|
3200 |
94047501 |
sh1194 |
E |
Sept. 28, 2020, 4:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
218 |
24166400 |
|
3200 |
94026564 |
master11941140 |
E |
Sept. 27, 2020, 6:39 p.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
218 |
24166400 |
|
3200 |
94026432 |
master11941140 |
E |
Sept. 27, 2020, 6:37 p.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
218 |
24166400 |
|
3200 |
94015916 |
blackbori |
E |
Sept. 27, 2020, 4:55 p.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
218 |
24166400 |
|
3200 |
94046134 |
jiangly |
E |
Sept. 28, 2020, 4:08 a.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
218 |
26112000 |
|
3200 |
93993245 |
ksun48 |
E |
Sept. 27, 2020, 3:49 p.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
218 |
28160000 |
|
3200 |
94025025 |
shubham__36 |
E |
Sept. 27, 2020, 6:18 p.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
233 |
28160000 |
|
3200 |
94043934 |
zhouzhendong |
E |
Sept. 28, 2020, 3:17 a.m. |
OK |
GNU C++17 (64) |
TESTS |
62 |
296 |
48230400 |
|
3200 |
remove filters
Back to search problems