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 an array a_1, a_2, ... , a_n , where each element is an integer from 1 to x . You can perform the following operation with it any number of times: In other words, you choose a subsegment of the array and an integer from 1 to x which does not appear in that subsegment, and replace every element in the subsegment with that chosen integer. Your goal is to make all elements in the array equal. What is the minimum number of operations that you have to perform? The first line contains one integer t ( 1 <= t <= 100 ) -- the number of test cases. Each test case consists of two lines: Additional constraint on the input: the sum of n over all test cases does not exceed 500 . For each test case, print one integer -- the minimum number of operations you have to perform. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
242322786 |
mban259 |
F |
Jan. 18, 2024, 4:43 p.m. |
OK |
C# 10 |
TESTS |
41 |
109 |
24166400 |
|
|
242368128 |
Prappo_All_Nishat |
F |
Jan. 19, 2024, 3:27 a.m. |
OK |
GNU C11 |
TESTS |
41 |
187 |
4505600 |
|
|
242365620 |
Hell2Evator |
F |
Jan. 19, 2024, 2:45 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
31 |
5632000 |
|
|
242323244 |
jeff252 |
F |
Jan. 18, 2024, 4:44 p.m. |
OK |
GNU C++17 |
TESTS |
41 |
31 |
16076800 |
|
|
242379989 |
lcyxds |
F |
Jan. 19, 2024, 5:49 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
62 |
10752000 |
|
|
242325925 |
lamduybao03 |
F |
Jan. 18, 2024, 4:54 p.m. |
OK |
GNU C++17 |
TESTS |
41 |
77 |
9420800 |
|
|
242338682 |
ywjylx |
F |
Jan. 18, 2024, 6:15 p.m. |
OK |
GNU C++17 |
TESTS |
41 |
202 |
8294400 |
|
|
242360146 |
prairie2022 |
F |
Jan. 19, 2024, 12:36 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
249 |
2048000 |
|
|
242328882 |
JJaewon |
F |
Jan. 18, 2024, 5:09 p.m. |
OK |
GNU C++17 |
TESTS |
41 |
373 |
8294400 |
|
|
242328476 |
JJaewon |
F |
Jan. 18, 2024, 5:07 p.m. |
OK |
GNU C++17 |
TESTS |
41 |
374 |
8294400 |
|
|
242369741 |
little_vegetable |
F |
Jan. 19, 2024, 3:50 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
405 |
13926400 |
|
|
242373203 |
liaopengfei |
F |
Jan. 19, 2024, 4:42 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
421 |
9318400 |
|
|
242328249 |
sizan43 |
F |
Jan. 18, 2024, 5:06 p.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
30 |
307200 |
|
|
242380623 |
__TRUE__ |
F |
Jan. 19, 2024, 5:54 a.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
31 |
10035200 |
|
|
242373935 |
wrihapcod |
F |
Jan. 19, 2024, 4:50 a.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
31 |
13619200 |
|
|
242370729 |
Galetx |
F |
Jan. 19, 2024, 4:04 a.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
62 |
9318400 |
|
|
242372852 |
chenyanxi |
F |
Jan. 19, 2024, 4:36 a.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
78 |
5120000 |
|
|
242372780 |
chenyanxi |
F |
Jan. 19, 2024, 4:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
78 |
5120000 |
|
|
242365992 |
TLE_Automaton |
F |
Jan. 19, 2024, 2:51 a.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
171 |
9318400 |
|
|
242358568 |
chappy1 |
F |
Jan. 18, 2024, 11:37 p.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
234 |
8499200 |
|
|
242378075 |
DS_Tape |
F |
Jan. 19, 2024, 5:33 a.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
249 |
11161600 |
|
|
242339819 |
yd_tz |
F |
Jan. 18, 2024, 6:24 p.m. |
OK |
GNU C++17 (64) |
TESTS |
41 |
296 |
9318400 |
|
|
242367665 |
ghoul932 |
F |
Jan. 19, 2024, 3:20 a.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
15 |
204800 |
|
|
242366135 |
DybalaFFF765657 |
F |
Jan. 19, 2024, 2:53 a.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
15 |
307200 |
|
|
242368006 |
EasonLiang |
F |
Jan. 19, 2024, 3:25 a.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
15 |
409600 |
|
|
242368113 |
EasonLiang |
F |
Jan. 19, 2024, 3:27 a.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
15 |
409600 |
|
|
242353990 |
NeverCompromise |
F |
Jan. 18, 2024, 9:23 p.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
15 |
614400 |
|
|
242355034 |
Kude |
F |
Jan. 18, 2024, 9:48 p.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
15 |
4096000 |
|
|
242362207 |
ikaurov |
F |
Jan. 19, 2024, 1:33 a.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
30 |
9318400 |
|
|
242370163 |
lprdsb |
F |
Jan. 19, 2024, 3:56 a.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
31 |
102400 |
|
|
242353946 |
NeverCompromise |
F |
Jan. 18, 2024, 9:22 p.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
31 |
614400 |
|
|
242353411 |
NeverCompromise |
F |
Jan. 18, 2024, 9:10 p.m. |
OK |
GNU C++20 (64) |
TESTS |
41 |
31 |
614400 |
|
|
242329616 |
Yassinjan |
F |
Jan. 18, 2024, 5:13 p.m. |
OK |
Java 8 |
TESTS |
41 |
1747 |
6246400 |
|
|
242372001 |
OLOGY |
F |
Jan. 19, 2024, 4:23 a.m. |
OK |
PyPy 2 |
TESTS |
41 |
265 |
7884800 |
|
|
242364139 |
OLOGY |
F |
Jan. 19, 2024, 2:17 a.m. |
OK |
Python 2 |
TESTS |
41 |
1731 |
204800 |
|
|
242370301 |
OLOGY |
F |
Jan. 19, 2024, 3:58 a.m. |
OK |
Python 2 |
TESTS |
41 |
1809 |
204800 |
|
|
242364065 |
OLOGY |
F |
Jan. 19, 2024, 2:15 a.m. |
OK |
Python 2 |
TESTS |
41 |
1809 |
204800 |
|
|
242361302 |
OLOGY |
F |
Jan. 19, 2024, 1:11 a.m. |
OK |
Python 2 |
TESTS |
41 |
1902 |
5222400 |
|
|
242360131 |
OLOGY |
F |
Jan. 19, 2024, 12:35 a.m. |
OK |
Python 2 |
TESTS |
41 |
2230 |
5324800 |
|
|
242360636 |
OLOGY |
F |
Jan. 19, 2024, 12:51 a.m. |
OK |
Python 2 |
TESTS |
41 |
2370 |
5324800 |
|
|
242360546 |
OLOGY |
F |
Jan. 19, 2024, 12:48 a.m. |
OK |
Python 2 |
TESTS |
41 |
2433 |
5324800 |
|
|
remove filters
Back to search problems