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 two integer arrays: array a of length n and array b of length n+1 . You can perform the following operations any number of times in any order: Your task is to calculate the minimum number of aforementioned operations (possibly zero) required to transform the array a into the array b . It can be shown that under the constraints of the problem, it is always possible. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. Each test case consists of three lines: Additional constraint on the input: the sum of n over all test cases doesn't exceed 2 cdot 10^5 . For each test case, print a single integer -- the minimum number of operations (possibly zero) required to transform the array a into the array b . In the first example, you can transform a into b as follows: [2] rightarrow [2, 2] rightarrow [1, 2] rightarrow [1, 3] . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
263437647 |
og.kostya |
B |
May 31, 2024, 8:37 a.m. |
OK |
C# 10 |
TESTS |
83 |
140 |
2457600 |
|
|
263401584 |
karamkontar |
B |
May 31, 2024, 2:53 a.m. |
OK |
C# 10 |
TESTS |
83 |
233 |
43724800 |
|
|
263541338 |
xELMXx |
B |
May 31, 2024, 6:48 p.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
124 |
0 |
|
|
263415498 |
devilhacker108 |
B |
May 31, 2024, 5:35 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
124 |
0 |
|
|
263407182 |
gunjackk28 |
B |
May 31, 2024, 4:09 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
124 |
0 |
|
|
263565512 |
MrPython |
B |
June 1, 2024, 2:48 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
124 |
0 |
|
|
263401294 |
amitmishra4447 |
B |
May 31, 2024, 2:49 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
124 |
0 |
|
|
263427833 |
Cras0432 |
B |
May 31, 2024, 7:17 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
124 |
1638400 |
|
|
263428209 |
Cgetier01 |
B |
May 31, 2024, 7:19 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
124 |
1638400 |
|
|
263396240 |
sunwenhan1 |
B |
May 31, 2024, 1:06 a.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
124 |
80179200 |
|
|
263541749 |
vivek2711 |
B |
May 31, 2024, 6:53 p.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
125 |
0 |
|
|
263515227 |
Amireuxqwq |
B |
May 31, 2024, 2:53 p.m. |
OK |
C++14 (GCC 6-32) |
TESTS |
83 |
125 |
1638400 |
|
|
263561505 |
luogu_bot5 |
B |
June 1, 2024, 1:37 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
77 |
5222400 |
|
|
263558082 |
luogu_bot2 |
B |
June 1, 2024, 12:12 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
77 |
5222400 |
|
|
263572378 |
omdabhade18705 |
B |
June 1, 2024, 4:17 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
109 |
0 |
|
|
263413193 |
dipuk656wx |
B |
May 31, 2024, 5:14 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
109 |
102400 |
|
|
263626025 |
m_bhaskar |
B |
June 1, 2024, 12:04 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
124 |
0 |
|
|
263688286 |
omeganot |
B |
June 2, 2024, 12:42 a.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
124 |
0 |
|
|
263666439 |
defender_ |
B |
June 1, 2024, 5:54 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
124 |
0 |
|
|
263655343 |
harshie_ |
B |
June 1, 2024, 4:18 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
124 |
0 |
|
|
263647687 |
rhkihs |
B |
June 1, 2024, 3:13 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
124 |
0 |
|
|
263640501 |
tdpencil |
B |
June 1, 2024, 2:11 p.m. |
OK |
C++17 (GCC 7-32) |
TESTS |
83 |
124 |
0 |
|
|
263694048 |
N_z__ |
B |
June 2, 2024, 3:06 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
62 |
204800 |
|
|
263576237 |
UltramanBlazer |
B |
June 1, 2024, 5:06 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
77 |
102400 |
|
|
263581803 |
UltramanDecker |
B |
June 1, 2024, 6:05 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
77 |
102400 |
|
|
263569746 |
Fresca |
B |
June 1, 2024, 3:46 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
77 |
102400 |
|
|
263652778 |
kevin |
B |
June 1, 2024, 3:57 p.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
93 |
102400 |
|
|
263561346 |
shady1972 |
B |
June 1, 2024, 1:34 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
93 |
102400 |
|
|
263415866 |
Ferrriccc |
B |
May 31, 2024, 5:38 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
93 |
102400 |
|
|
263410692 |
pangwt |
B |
May 31, 2024, 4:48 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
93 |
102400 |
|
|
263402464 |
EndStarry |
B |
May 31, 2024, 3:07 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
93 |
102400 |
|
|
263395209 |
remain11 |
B |
May 31, 2024, 12:36 a.m. |
OK |
C++20 (GCC 13-64) |
TESTS |
83 |
93 |
1740800 |
|
|
263395284 |
bluemegane |
B |
May 31, 2024, 12:39 a.m. |
OK |
C# 8 |
TESTS |
83 |
202 |
35020800 |
|
|
263417547 |
Shanmukh_Villuri |
B |
May 31, 2024, 5:54 a.m. |
OK |
GNU C11 |
TESTS |
83 |
124 |
1843200 |
|
|
263534818 |
Anonymous_HF |
B |
May 31, 2024, 5:44 p.m. |
OK |
GNU C11 |
TESTS |
83 |
140 |
1536000 |
|
|
263577409 |
enthsxpzm |
B |
June 1, 2024, 5:19 a.m. |
OK |
GNU C11 |
TESTS |
83 |
140 |
1740800 |
|
|
263403590 |
AbNv069 |
B |
May 31, 2024, 3:23 a.m. |
OK |
GNU C11 |
TESTS |
83 |
140 |
3072000 |
|
|
263429341 |
deb_ppt |
B |
May 31, 2024, 7:29 a.m. |
OK |
GNU C11 |
TESTS |
83 |
140 |
4812800 |
|
|
263415596 |
AKOvinno |
B |
May 31, 2024, 5:36 a.m. |
OK |
GNU C11 |
TESTS |
83 |
155 |
3174400 |
|
|
263511838 |
QuaCode |
B |
May 31, 2024, 2:25 p.m. |
OK |
GNU C11 |
TESTS |
83 |
155 |
3276800 |
|
|
263409999 |
Tusunine |
B |
May 31, 2024, 4:41 a.m. |
OK |
GNU C11 |
TESTS |
83 |
156 |
1536000 |
|
|
263413564 |
Justadi698 |
B |
May 31, 2024, 5:17 a.m. |
OK |
GNU C11 |
TESTS |
83 |
202 |
3174400 |
|
|
263398735 |
suyureo |
B |
May 31, 2024, 2:03 a.m. |
OK |
GNU C11 |
TESTS |
83 |
1249 |
3276800 |
|
|
263657221 |
nguyenquocthao00 |
B |
June 1, 2024, 4:33 p.m. |
OK |
Go |
TESTS |
83 |
77 |
12800000 |
|
|
263393255 |
crapcode |
B |
May 30, 2024, 11:37 p.m. |
OK |
Go |
TESTS |
83 |
249 |
7782400 |
|
|
263401125 |
coder0687 |
B |
May 31, 2024, 2:47 a.m. |
OK |
Java 21 |
TESTS |
83 |
296 |
1228800 |
|
|
263395939 |
Mg718 |
B |
May 31, 2024, 12:57 a.m. |
OK |
Java 21 |
TESTS |
83 |
327 |
1228800 |
|
|
263541518 |
shaili17 |
B |
May 31, 2024, 6:50 p.m. |
OK |
Java 21 |
TESTS |
83 |
358 |
7168000 |
|
|
263629057 |
-Jarvis- |
B |
June 1, 2024, 12:30 p.m. |
OK |
Java 21 |
TESTS |
83 |
359 |
8294400 |
|
|
263384022 |
Rishabh_Coder2003 |
B |
May 30, 2024, 8:14 p.m. |
OK |
Java 21 |
TESTS |
83 |
374 |
10649600 |
|
|
263534605 |
SD125 |
B |
May 31, 2024, 5:42 p.m. |
OK |
Java 21 |
TESTS |
83 |
389 |
6963200 |
|
|
263388294 |
wizwilzo |
B |
May 30, 2024, 9:29 p.m. |
OK |
Java 21 |
TESTS |
83 |
390 |
7372800 |
|
|
263624747 |
rams47 |
B |
June 1, 2024, 11:54 a.m. |
OK |
Java 21 |
TESTS |
83 |
390 |
76902400 |
|
|
263641448 |
narayan.xrd |
B |
June 1, 2024, 2:20 p.m. |
OK |
Java 21 |
TESTS |
83 |
405 |
8704000 |
|
|
263381557 |
dzhi |
B |
May 30, 2024, 7:37 p.m. |
OK |
Java 21 |
TESTS |
83 |
405 |
8806400 |
|
|
263575783 |
yvbf |
B |
June 1, 2024, 5 a.m. |
OK |
Java 8 |
TESTS |
83 |
171 |
0 |
|
|
263393678 |
nis1234 |
B |
May 30, 2024, 11:51 p.m. |
OK |
Java 8 |
TESTS |
83 |
187 |
0 |
|
|
263513866 |
wuhu_ac |
B |
May 31, 2024, 2:42 p.m. |
OK |
Java 8 |
TESTS |
83 |
249 |
0 |
|
|
263417020 |
Q_R_Y |
B |
May 31, 2024, 5:50 a.m. |
OK |
Java 8 |
TESTS |
83 |
249 |
0 |
|
|
263589385 |
coderman2004 |
B |
June 1, 2024, 7:09 a.m. |
OK |
Java 8 |
TESTS |
83 |
265 |
17510400 |
|
|
263509746 |
abdulrahmanElfeky |
B |
May 31, 2024, 2:09 p.m. |
OK |
Java 8 |
TESTS |
83 |
265 |
17612800 |
|
|
263696159 |
WindLY |
B |
June 2, 2024, 3:47 a.m. |
OK |
Java 8 |
TESTS |
83 |
358 |
19968000 |
|
|
263674149 |
joycelalalayaa |
B |
June 1, 2024, 7:14 p.m. |
OK |
Java 8 |
TESTS |
83 |
718 |
0 |
|
|
263570142 |
Rianj |
B |
June 1, 2024, 3:51 a.m. |
OK |
Java 8 |
TESTS |
83 |
718 |
0 |
|
|
263411850 |
alllexey |
B |
May 31, 2024, 5 a.m. |
OK |
Java 8 |
TESTS |
83 |
733 |
0 |
|
|
263580569 |
SecondThread |
B |
June 1, 2024, 5:53 a.m. |
OK |
Kotlin 1.9 |
TESTS |
83 |
437 |
21196800 |
|
|
263400827 |
gouravasdeo11 |
B |
May 31, 2024, 2:42 a.m. |
OK |
Kotlin 1.9 |
TESTS |
83 |
765 |
0 |
|
|
263687637 |
nealzane |
B |
June 2, 2024, 12:18 a.m. |
OK |
PyPy 3 |
TESTS |
83 |
358 |
25395200 |
|
|
263401001 |
JeanExtreme002 |
B |
May 31, 2024, 2:45 a.m. |
OK |
PyPy 3 |
TESTS |
83 |
734 |
23552000 |
|
|
263653533 |
sky_coder_ |
B |
June 1, 2024, 4:03 p.m. |
OK |
PyPy 3 |
TESTS |
83 |
749 |
23347200 |
|
|
263407010 |
papdichaat |
B |
May 31, 2024, 4:07 a.m. |
OK |
PyPy 3 |
TESTS |
83 |
750 |
22732800 |
|
|
263427154 |
Tomy_Aman |
B |
May 31, 2024, 7:12 a.m. |
OK |
PyPy 3 |
TESTS |
83 |
765 |
22937600 |
|
|
263649182 |
codsila |
B |
June 1, 2024, 3:27 p.m. |
OK |
PyPy 3 |
TESTS |
83 |
781 |
22528000 |
|
|
263383752 |
Kefrov |
B |
May 30, 2024, 8:09 p.m. |
OK |
PyPy 3 |
TESTS |
83 |
781 |
23552000 |
|
|
263412226 |
arnav_satwik |
B |
May 31, 2024, 5:04 a.m. |
OK |
PyPy 3 |
TESTS |
83 |
843 |
23142400 |
|
|
263425174 |
Deepak_0123 |
B |
May 31, 2024, 6:56 a.m. |
OK |
PyPy 3 |
TESTS |
83 |
890 |
22732800 |
|
|
263593585 |
kernelpopped |
B |
June 1, 2024, 7:44 a.m. |
OK |
PyPy 3 |
TESTS |
83 |
906 |
23552000 |
|
|
263398994 |
udayan8 |
B |
May 31, 2024, 2:08 a.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
187 |
42598400 |
|
|
263601163 |
Youarenotgood |
B |
June 1, 2024, 8:47 a.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
202 |
34508800 |
|
|
263554870 |
MistaFlash |
B |
May 31, 2024, 10:40 p.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
217 |
34713600 |
|
|
263409117 |
gardengnome |
B |
May 31, 2024, 4:31 a.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
217 |
35635200 |
|
|
263514606 |
bergus |
B |
May 31, 2024, 2:48 p.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
218 |
30617600 |
|
|
263609345 |
Shri_874 |
B |
June 1, 2024, 9:54 a.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
218 |
33792000 |
|
|
263401225 |
smilences |
B |
May 31, 2024, 2:48 a.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
218 |
34816000 |
|
|
263524881 |
elnazar |
B |
May 31, 2024, 4:16 p.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
218 |
35942400 |
|
|
263533628 |
singh.eureka |
B |
May 31, 2024, 5:34 p.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
218 |
39833600 |
|
|
263542049 |
sangeeta |
B |
May 31, 2024, 6:57 p.m. |
OK |
PyPy 3-64 |
TESTS |
83 |
218 |
40038400 |
|
|
263418503 |
veera_teja_007 |
B |
May 31, 2024, 6:03 a.m. |
OK |
Python 3 |
TESTS |
83 |
280 |
36454400 |
|
|
263532391 |
rhythempjain |
B |
May 31, 2024, 5:23 p.m. |
OK |
Python 3 |
TESTS |
83 |
296 |
36454400 |
|
|
263705245 |
DC_0001 |
B |
June 2, 2024, 5:59 a.m. |
OK |
Python 3 |
TESTS |
83 |
343 |
36556800 |
|
|
263535151 |
onecode182 |
B |
May 31, 2024, 5:47 p.m. |
OK |
Python 3 |
TESTS |
83 |
358 |
36454400 |
|
|
263626293 |
RISHITHA_ |
B |
June 1, 2024, 12:06 p.m. |
OK |
Python 3 |
TESTS |
83 |
359 |
36454400 |
|
|
263577544 |
pennymagic156 |
B |
June 1, 2024, 5:21 a.m. |
OK |
Python 3 |
TESTS |
83 |
374 |
36454400 |
|
|
263416162 |
onecode182 |
B |
May 31, 2024, 5:41 a.m. |
OK |
Python 3 |
TESTS |
83 |
374 |
36454400 |
|
|
263415659 |
onecode182 |
B |
May 31, 2024, 5:36 a.m. |
OK |
Python 3 |
TESTS |
83 |
389 |
36454400 |
|
|
263645157 |
__empty__ |
B |
June 1, 2024, 2:51 p.m. |
OK |
Python 3 |
TESTS |
83 |
390 |
34406400 |
|
|
263514619 |
Ice_Bear |
B |
May 31, 2024, 2:48 p.m. |
OK |
Python 3 |
TESTS |
83 |
390 |
36249600 |
|
|
263384661 |
mash97 |
B |
May 30, 2024, 8:25 p.m. |
OK |
Ruby 3 |
TESTS |
83 |
733 |
63692800 |
|
|
263419409 |
rishabhxchoudhary |
B |
May 31, 2024, 6:11 a.m. |
OK |
Rust 2021 |
TESTS |
83 |
93 |
6246400 |
|
|
263399256 |
n0b0dy01 |
B |
May 31, 2024, 2:13 a.m. |
OK |
Rust 2021 |
TESTS |
83 |
124 |
9318400 |
|
|
263599990 |
M1ngXu |
B |
June 1, 2024, 8:37 a.m. |
OK |
Rust 2021 |
TESTS |
83 |
186 |
0 |
|
|
remove filters
Back to search problems