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'Igor is in 11th grade. Tomorrow he will have to write an informatics test by the strictest teacher in the school, Pavel Denisovich. Igor knows how the test will be conducted: first of all, the teacher will give each student two positive integers a and b ( a < b ). After that, the student can apply any of the following operations any number of times: To get full marks on the test, the student has to tell the teacher the minimum required number of operations to make a and b equal. Igor already knows which numbers the teacher will give him. Help him figure out what is the minimum number of operations needed to make a equal to b . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). Description of the test cases follows. The only line for each test case contains two integers a and b ( 1 <= a < b <= 10^6 ). It is guaranteed that the sum of b over all test cases does not exceed 10^6 . For each test case print one integer -- the minimum required number of operations to make a and b equal. In the first test case, it is optimal to apply the third operation. In the second test case, it is optimal to apply the first operation three times. In the third test case, it is optimal to apply the second operation and then the third operation. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
144602457 |
eastnman |
C |
Jan. 30, 2022, 10:22 p.m. |
OK |
Delphi |
TESTS |
40 |
31 |
102400 |
|
|
144600090 |
rainboy |
C |
Jan. 30, 2022, 8:54 p.m. |
OK |
GNU C11 |
TESTS |
40 |
46 |
0 |
|
|
144600588 |
rainboy |
C |
Jan. 30, 2022, 9:07 p.m. |
OK |
GNU C11 |
TESTS |
40 |
46 |
0 |
|
|
144591655 |
saker.hajji |
C |
Jan. 30, 2022, 6:17 p.m. |
OK |
GNU C11 |
TESTS |
40 |
46 |
0 |
|
|
144613198 |
duoluoluo |
C |
Jan. 31, 2022, 5:03 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144613167 |
cicada2020 |
C |
Jan. 31, 2022, 5:02 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144613158 |
amitbhamboo56504 |
C |
Jan. 31, 2022, 5:02 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144612894 |
sailboat22 |
C |
Jan. 31, 2022, 4:58 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144615495 |
sachiniit |
C |
Jan. 31, 2022, 5:38 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144614714 |
_ManaV_ |
C |
Jan. 31, 2022, 5:26 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144614099 |
AbhinavBisht |
C |
Jan. 31, 2022, 5:17 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144613737 |
Fetus86 |
C |
Jan. 31, 2022, 5:12 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144616751 |
karan_yt |
C |
Jan. 31, 2022, 5:57 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144616083 |
karan_yt |
C |
Jan. 31, 2022, 5:48 a.m. |
OK |
GNU C++14 |
TESTS |
40 |
15 |
0 |
|
|
144616815 |
._karma_. |
C |
Jan. 31, 2022, 5:58 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144616721 |
Moh_maya |
C |
Jan. 31, 2022, 5:56 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144616021 |
manavsaraf |
C |
Jan. 31, 2022, 5:47 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144615966 |
BattleOoze |
C |
Jan. 31, 2022, 5:46 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144615934 |
srijay |
C |
Jan. 31, 2022, 5:45 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144615879 |
M-o-b-a-r-a-k |
C |
Jan. 31, 2022, 5:45 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144615601 |
voyager_08 |
C |
Jan. 31, 2022, 5:40 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144617023 |
Rajat850 |
C |
Jan. 31, 2022, 6:01 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144616895 |
SmallVegetableDog |
C |
Jan. 31, 2022, 5:59 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144616890 |
Moh_maya |
C |
Jan. 31, 2022, 5:59 a.m. |
OK |
GNU C++17 |
TESTS |
40 |
15 |
0 |
|
|
144617031 |
it_aint_me |
C |
Jan. 31, 2022, 6:01 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144616948 |
jb_2402 |
C |
Jan. 31, 2022, 6 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144616430 |
anil_1 |
C |
Jan. 31, 2022, 5:53 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144616243 |
sanket- |
C |
Jan. 31, 2022, 5:50 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144614465 |
yashmnc |
C |
Jan. 31, 2022, 5:23 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144613870 |
LittleCube |
C |
Jan. 31, 2022, 5:14 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144613868 |
Vr_07 |
C |
Jan. 31, 2022, 5:14 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144613726 |
fr1234 |
C |
Jan. 31, 2022, 5:11 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144613384 |
_Akagami_ |
C |
Jan. 31, 2022, 5:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144612939 |
Makha |
C |
Jan. 31, 2022, 4:59 a.m. |
OK |
GNU C++17 (64) |
TESTS |
40 |
15 |
0 |
|
|
144615174 |
sirvi_26 |
C |
Jan. 31, 2022, 5:33 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144614911 |
AnACPlease |
C |
Jan. 31, 2022, 5:29 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144614803 |
shmad |
C |
Jan. 31, 2022, 5:28 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144613958 |
Harsh_Chugh |
C |
Jan. 31, 2022, 5:15 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144613469 |
HP_BenLadeN |
C |
Jan. 31, 2022, 5:07 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144613102 |
Milind_Sharma |
C |
Jan. 31, 2022, 5:01 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144612563 |
Zerologic_Infinity |
C |
Jan. 31, 2022, 4:51 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144615289 |
Mr_Skills |
C |
Jan. 31, 2022, 5:35 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144615771 |
HalfStar |
C |
Jan. 31, 2022, 5:43 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144616011 |
shmad |
C |
Jan. 31, 2022, 5:46 a.m. |
OK |
GNU C++20 (64) |
TESTS |
40 |
15 |
0 |
|
|
144605119 |
0x3F |
C |
Jan. 31, 2022, 1:10 a.m. |
OK |
Go |
TESTS |
40 |
30 |
102400 |
|
|
144616140 |
__Serendipity |
C |
Jan. 31, 2022, 5:48 a.m. |
OK |
Java 11 |
TESTS |
40 |
171 |
0 |
|
|
144593141 |
Halix |
C |
Jan. 30, 2022, 6:37 p.m. |
OK |
Java 11 |
TESTS |
40 |
171 |
0 |
|
|
144592386 |
aashay_03 |
C |
Jan. 30, 2022, 6:27 p.m. |
OK |
Java 11 |
TESTS |
40 |
171 |
0 |
|
|
144592324 |
aashay_03 |
C |
Jan. 30, 2022, 6:26 p.m. |
OK |
Java 11 |
TESTS |
40 |
171 |
0 |
|
|
144589382 |
_ryan18_ |
C |
Jan. 30, 2022, 5:51 p.m. |
OK |
Java 11 |
TESTS |
40 |
171 |
0 |
|
|
144575580 |
akash132 |
C |
Jan. 30, 2022, 4:18 p.m. |
OK |
Java 11 |
TESTS |
40 |
171 |
0 |
|
|
144611215 |
Sandy_coder2001 |
C |
Jan. 31, 2022, 4:26 a.m. |
OK |
Java 11 |
TESTS |
40 |
186 |
0 |
|
|
144589949 |
eshan18.09 |
C |
Jan. 30, 2022, 5:57 p.m. |
OK |
Java 11 |
TESTS |
40 |
186 |
0 |
|
|
144578533 |
sauravmandal |
C |
Jan. 30, 2022, 4:25 p.m. |
OK |
Java 11 |
TESTS |
40 |
186 |
0 |
|
|
144574828 |
SavageClown007 |
C |
Jan. 30, 2022, 4:17 p.m. |
OK |
Java 11 |
TESTS |
40 |
186 |
0 |
|
|
144595736 |
Swapniltri |
C |
Jan. 30, 2022, 7:19 p.m. |
OK |
Java 8 |
TESTS |
40 |
93 |
0 |
|
|
144587489 |
VishuTomar |
C |
Jan. 30, 2022, 5:33 p.m. |
OK |
Java 8 |
TESTS |
40 |
108 |
0 |
|
|
144615107 |
alibaba |
C |
Jan. 31, 2022, 5:32 a.m. |
OK |
Java 8 |
TESTS |
40 |
109 |
0 |
|
|
144588523 |
chinmaya21 |
C |
Jan. 30, 2022, 5:43 p.m. |
OK |
Java 8 |
TESTS |
40 |
109 |
0 |
|
|
144585218 |
NoobAk |
C |
Jan. 30, 2022, 5:17 p.m. |
OK |
Java 8 |
TESTS |
40 |
109 |
0 |
|
|
144576619 |
TCchen |
C |
Jan. 30, 2022, 4:21 p.m. |
OK |
Java 8 |
TESTS |
40 |
109 |
0 |
|
|
144585756 |
arpit31 |
C |
Jan. 30, 2022, 5:20 p.m. |
OK |
Java 8 |
TESTS |
40 |
124 |
0 |
|
|
144601985 |
viniichuk |
C |
Jan. 30, 2022, 9:58 p.m. |
OK |
Java 8 |
TESTS |
40 |
140 |
0 |
|
|
144597541 |
sanjayram21 |
C |
Jan. 30, 2022, 7:53 p.m. |
OK |
Java 8 |
TESTS |
40 |
140 |
0 |
|
|
144613281 |
gssakash |
C |
Jan. 31, 2022, 5:04 a.m. |
OK |
Java 8 |
TESTS |
40 |
155 |
0 |
|
|
144574256 |
_V3V_ |
C |
Jan. 30, 2022, 4:15 p.m. |
OK |
MS C++ 2017 |
TESTS |
40 |
15 |
2867200 |
|
|
144577147 |
kitbuilder |
C |
Jan. 30, 2022, 4:22 p.m. |
OK |
MS C++ 2017 |
TESTS |
40 |
46 |
0 |
|
|
144574470 |
ABalobanov |
C |
Jan. 30, 2022, 4:16 p.m. |
OK |
MS C++ 2017 |
TESTS |
40 |
62 |
0 |
|
|
144597394 |
psn2706 |
C |
Jan. 30, 2022, 7:50 p.m. |
OK |
MS C++ 2017 |
TESTS |
40 |
62 |
102400 |
|
|
144596992 |
psn2706 |
C |
Jan. 30, 2022, 7:42 p.m. |
OK |
MS C++ 2017 |
TESTS |
40 |
93 |
204800 |
|
|
144597276 |
psn2706 |
C |
Jan. 30, 2022, 7:48 p.m. |
OK |
MS C++ 2017 |
TESTS |
40 |
109 |
204800 |
|
|
144595427 |
rsFalse |
C |
Jan. 30, 2022, 7:13 p.m. |
OK |
Perl |
TESTS |
40 |
280 |
102400 |
|
|
144594102 |
rsFalse |
C |
Jan. 30, 2022, 6:52 p.m. |
OK |
Perl |
TESTS |
40 |
374 |
102400 |
|
|
144590597 |
rsFalse |
C |
Jan. 30, 2022, 6:04 p.m. |
OK |
Perl |
TESTS |
40 |
390 |
102400 |
|
|
144585668 |
1_2_3_4_5_9 |
C |
Jan. 30, 2022, 5:20 p.m. |
OK |
PyPy 2 |
TESTS |
40 |
93 |
2150400 |
|
|
144578475 |
you1234 |
C |
Jan. 30, 2022, 4:25 p.m. |
OK |
PyPy 2 |
TESTS |
40 |
218 |
1945600 |
|
|
144589364 |
OLOGY |
C |
Jan. 30, 2022, 5:51 p.m. |
OK |
PyPy 2 |
TESTS |
40 |
233 |
2457600 |
|
|
144585520 |
OLOGY |
C |
Jan. 30, 2022, 5:19 p.m. |
OK |
PyPy 2 |
TESTS |
40 |
248 |
2662400 |
|
|
144588359 |
Ahmed_Turkman |
C |
Jan. 30, 2022, 5:41 p.m. |
OK |
PyPy 3 |
TESTS |
40 |
140 |
5324800 |
|
|
144587395 |
Ahmed_Turkman |
C |
Jan. 30, 2022, 5:32 p.m. |
OK |
PyPy 3 |
TESTS |
40 |
155 |
4096000 |
|
|
144612914 |
majay1638 |
C |
Jan. 31, 2022, 4:58 a.m. |
OK |
PyPy 3 |
TESTS |
40 |
155 |
7270400 |
|
|
144609561 |
ACoder_25 |
C |
Jan. 31, 2022, 3:51 a.m. |
OK |
PyPy 3 |
TESTS |
40 |
156 |
6963200 |
|
|
144586304 |
Aestroix |
C |
Jan. 30, 2022, 5:24 p.m. |
OK |
PyPy 3 |
TESTS |
40 |
187 |
7987200 |
|
|
144595886 |
raideva |
C |
Jan. 30, 2022, 7:21 p.m. |
OK |
PyPy 3 |
TESTS |
40 |
202 |
7270400 |
|
|
144585735 |
sangram03 |
C |
Jan. 30, 2022, 5:20 p.m. |
OK |
PyPy 3 |
TESTS |
40 |
233 |
10240000 |
|
|
144606308 |
LispWizard |
C |
Jan. 31, 2022, 2:12 a.m. |
OK |
PyPy 3 |
TESTS |
40 |
234 |
5120000 |
|
|
144584949 |
kwin |
C |
Jan. 30, 2022, 5:16 p.m. |
OK |
PyPy 3 |
TESTS |
40 |
264 |
6348800 |
|
|
144574175 |
mnkqc |
C |
Jan. 30, 2022, 4:15 p.m. |
OK |
PyPy 3 |
TESTS |
40 |
280 |
6656000 |
|
|
144592981 |
IkshitG |
C |
Jan. 30, 2022, 6:35 p.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
139 |
6041600 |
|
|
144585666 |
FlakeLCR |
C |
Jan. 30, 2022, 5:20 p.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
140 |
5222400 |
|
|
144599626 |
ossau_guildo |
C |
Jan. 30, 2022, 8:40 p.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
140 |
5939200 |
|
|
144589335 |
Het_Fadia |
C |
Jan. 30, 2022, 5:51 p.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
155 |
10035200 |
|
|
144576218 |
_nathan_drake_ |
C |
Jan. 30, 2022, 4:20 p.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
155 |
10752000 |
|
|
144581713 |
RANK1ZEN |
C |
Jan. 30, 2022, 4:32 p.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
171 |
10035200 |
|
|
144581153 |
190330184 |
C |
Jan. 30, 2022, 4:31 p.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
186 |
7884800 |
|
|
144615799 |
manish.17 |
C |
Jan. 31, 2022, 5:43 a.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
202 |
7680000 |
|
|
144592067 |
jayeshkumavat42 |
C |
Jan. 30, 2022, 6:22 p.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
202 |
9318400 |
|
|
144585252 |
Invinc3 |
C |
Jan. 30, 2022, 5:18 p.m. |
OK |
PyPy 3-64 |
TESTS |
40 |
202 |
11366400 |
|
|
144608695 |
arpan.parikh |
C |
Jan. 31, 2022, 3:29 a.m. |
OK |
Python 3 |
TESTS |
40 |
202 |
0 |
|
|
144613261 |
tesnikolai234 |
C |
Jan. 31, 2022, 5:04 a.m. |
OK |
Python 3 |
TESTS |
40 |
217 |
0 |
|
|
144579597 |
NKUCristiano |
C |
Jan. 30, 2022, 4:28 p.m. |
OK |
Python 3 |
TESTS |
40 |
217 |
102400 |
|
|
144578163 |
PitFiend13 |
C |
Jan. 30, 2022, 4:25 p.m. |
OK |
Python 3 |
TESTS |
40 |
295 |
0 |
|
|
144593369 |
sankalpsodagum7 |
C |
Jan. 30, 2022, 6:40 p.m. |
OK |
Python 3 |
TESTS |
40 |
296 |
0 |
|
|
144590447 |
keytime |
C |
Jan. 30, 2022, 6:03 p.m. |
OK |
Python 3 |
TESTS |
40 |
296 |
0 |
|
|
144589880 |
rinzller |
C |
Jan. 30, 2022, 5:56 p.m. |
OK |
Python 3 |
TESTS |
40 |
296 |
0 |
|
|
144584763 |
mazzz |
C |
Jan. 30, 2022, 5:16 p.m. |
OK |
Python 3 |
TESTS |
40 |
311 |
0 |
|
|
144615661 |
cholebhature |
C |
Jan. 31, 2022, 5:41 a.m. |
OK |
Python 3 |
TESTS |
40 |
327 |
0 |
|
|
144577535 |
sandesh32 |
C |
Jan. 30, 2022, 4:23 p.m. |
OK |
Python 3 |
TESTS |
40 |
421 |
0 |
|
|
144601490 |
kroyl |
C |
Jan. 30, 2022, 9:38 p.m. |
OK |
Rust 2021 |
TESTS |
40 |
15 |
0 |
|
|
144577264 |
clause |
C |
Jan. 30, 2022, 4:22 p.m. |
OK |
Rust 2021 |
TESTS |
40 |
108 |
0 |
|
|
remove filters
Back to search problems