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 have an initially empty cauldron, and you want to brew a potion in it. The potion consists of two ingredients: magic essence and water. The potion you want to brew should contain exactly k % magic essence and (100 - k) % water. In one step, you can pour either one liter of magic essence or one liter of water into the cauldron. What is the minimum number of steps to brew a potion? You don't care about the total volume of the potion, only about the ratio between magic essence and water in it. A small reminder: if you pour e liters of essence and w liters of water ( e + w > 0 ) into the cauldron, then it contains frac{e}{e + w} cdot 100 % (without rounding) magic essence and frac{w}{e + w} cdot 100 % water. The first line contains the single t ( 1 <= t <= 100 ) -- the number of test cases. The first and only line of each test case contains a single integer k ( 1 <= k <= 100 ) -- the percentage of essence in a good potion. For each test case, print the minimum number of steps to brew a good potion. It can be proved that it's always possible to achieve it in a finite number of steps. In the first test case, you should pour 3 liters of magic essence and 97 liters of water into the cauldron to get a potion with 3 % of magic essence. In the second test case, you can pour only 1 liter of essence to get a potion with 100 % of magic essence. In the third test case, you can pour 1 liter of magic essence and 3 liters of water. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
116427028 |
dinkan |
A |
May 16, 2021, 5:53 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
2 |
31 |
0 |
|
|
116390963 |
fpc_coder |
A |
May 16, 2021, 10:35 a.m. |
OK |
FPC |
TESTS |
2 |
15 |
0 |
|
|
116410668 |
Youmar24 |
A |
May 16, 2021, 2:14 p.m. |
OK |
FPC |
TESTS |
2 |
15 |
102400 |
|
|
116393381 |
sunder_ch60 |
A |
May 16, 2021, 11:01 a.m. |
OK |
GNU C11 |
TESTS |
2 |
0 |
0 |
|
|
116393228 |
sunder_ch60 |
A |
May 16, 2021, 10:59 a.m. |
OK |
GNU C11 |
TESTS |
2 |
0 |
0 |
|
|
116399294 |
luoye |
A |
May 16, 2021, 12:01 p.m. |
OK |
GNU C11 |
TESTS |
2 |
0 |
0 |
|
|
116401432 |
Iizshit |
A |
May 16, 2021, 12:25 p.m. |
OK |
GNU C11 |
TESTS |
2 |
0 |
0 |
|
|
116412192 |
20bcs030 |
A |
May 16, 2021, 2:33 p.m. |
OK |
GNU C11 |
TESTS |
2 |
0 |
0 |
|
|
116424009 |
Tahim_097 |
A |
May 16, 2021, 5:06 p.m. |
OK |
GNU C11 |
TESTS |
2 |
15 |
0 |
|
|
116444445 |
Vikas_Nakwal |
A |
May 17, 2021, 3:25 a.m. |
OK |
GNU C11 |
TESTS |
2 |
15 |
0 |
|
|
116428761 |
_jazz |
A |
May 16, 2021, 6:23 p.m. |
OK |
GNU C11 |
TESTS |
2 |
15 |
0 |
|
|
116443884 |
noobdecoder |
A |
May 17, 2021, 3:10 a.m. |
OK |
GNU C11 |
TESTS |
2 |
15 |
0 |
|
|
116440905 |
eugalt |
A |
May 17, 2021, 1:19 a.m. |
OK |
GNU C11 |
TESTS |
2 |
15 |
0 |
|
|
116440824 |
CryCK |
A |
May 17, 2021, 1:16 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116445939 |
caodat2210 |
A |
May 17, 2021, 4:01 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116444293 |
Youbuhua |
A |
May 17, 2021, 3:21 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116443624 |
xudong |
A |
May 17, 2021, 3:03 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116442636 |
shaily_shah99 |
A |
May 17, 2021, 2:31 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116441882 |
Crampedbore |
A |
May 17, 2021, 2:01 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116441758 |
shangxl |
A |
May 17, 2021, 1:56 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116441451 |
linuxll |
A |
May 17, 2021, 1:44 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116441450 |
gonghw403 |
A |
May 17, 2021, 1:44 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116439463 |
yujianjue |
A |
May 17, 2021, 12:10 a.m. |
OK |
GNU C++11 |
TESTS |
2 |
0 |
0 |
|
|
116440893 |
wd_sun |
A |
May 17, 2021, 1:18 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116445056 |
jsulyy |
A |
May 17, 2021, 3:40 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116447437 |
intealam96 |
A |
May 17, 2021, 4:36 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116431972 |
DarkTigerFAF |
A |
May 16, 2021, 7:23 p.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116430928 |
emon.49 |
A |
May 16, 2021, 7:02 p.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116448248 |
parv2809 |
A |
May 17, 2021, 4:53 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116435125 |
ankushdutt |
A |
May 16, 2021, 8:46 p.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116449890 |
Austere7 |
A |
May 17, 2021, 5:22 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116449943 |
uuuilu |
A |
May 17, 2021, 5:23 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116450834 |
mohit_1804 |
A |
May 17, 2021, 5:38 a.m. |
OK |
GNU C++14 |
TESTS |
2 |
0 |
0 |
|
|
116450984 |
fk_multi |
A |
May 17, 2021, 5:41 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116448917 |
Biswadip |
A |
May 17, 2021, 5:06 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116448823 |
rheallyc |
A |
May 17, 2021, 5:04 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116448631 |
bhargav0105 |
A |
May 17, 2021, 5 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116448474 |
noob_bear |
A |
May 17, 2021, 4:58 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116448355 |
mahjabinNISHA |
A |
May 17, 2021, 4:55 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116451938 |
skkingshuk |
A |
May 17, 2021, 5:57 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116451631 |
adarsh__786 |
A |
May 17, 2021, 5:52 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116451353 |
sidjoharwal |
A |
May 17, 2021, 5:48 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116449895 |
iam_abhi |
A |
May 17, 2021, 5:22 a.m. |
OK |
GNU C++17 |
TESTS |
2 |
0 |
0 |
|
|
116435522 |
any0ne |
A |
May 16, 2021, 8:59 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116441910 |
BiIIy |
A |
May 17, 2021, 2:01 a.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116438867 |
WizardAP |
A |
May 16, 2021, 11:35 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116436473 |
juankipedia |
A |
May 16, 2021, 9:36 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116435311 |
say_hi |
A |
May 16, 2021, 8:51 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116435027 |
jesse_pinkman_619 |
A |
May 16, 2021, 8:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116434305 |
timoffey14 |
A |
May 16, 2021, 8:21 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116432504 |
Roll_Num_56 |
A |
May 16, 2021, 7:35 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116432120 |
Huckleberry |
A |
May 16, 2021, 7:26 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116430274 |
_legend_ |
A |
May 16, 2021, 6:50 p.m. |
OK |
GNU C++17 (64) |
TESTS |
2 |
0 |
0 |
|
|
116445659 |
Leaf_Bebop |
A |
May 17, 2021, 3:54 a.m. |
OK |
Go |
TESTS |
2 |
15 |
0 |
|
|
116390828 |
yuvaraj_11 |
A |
May 16, 2021, 10:34 a.m. |
OK |
Go |
TESTS |
2 |
31 |
0 |
|
|
116419392 |
Sonam_Chhewang |
A |
May 16, 2021, 3:58 p.m. |
OK |
Java 11 |
TESTS |
2 |
139 |
0 |
|
|
116386405 |
kareem3id |
A |
May 16, 2021, 10:02 a.m. |
OK |
Java 11 |
TESTS |
2 |
140 |
0 |
|
|
116418402 |
RitGit |
A |
May 16, 2021, 3:46 p.m. |
OK |
Java 11 |
TESTS |
2 |
140 |
0 |
|
|
116394152 |
goyalronak3 |
A |
May 16, 2021, 11:08 a.m. |
OK |
Java 11 |
TESTS |
2 |
140 |
0 |
|
|
116445762 |
ExposedHost |
A |
May 17, 2021, 3:57 a.m. |
OK |
Java 11 |
TESTS |
2 |
155 |
0 |
|
|
116417933 |
dinosparton_013 |
A |
May 16, 2021, 3:40 p.m. |
OK |
Java 11 |
TESTS |
2 |
155 |
0 |
|
|
116427878 |
eulerian11 |
A |
May 16, 2021, 6:08 p.m. |
OK |
Java 11 |
TESTS |
2 |
155 |
0 |
|
|
116426637 |
pdk.abhishek |
A |
May 16, 2021, 5:47 p.m. |
OK |
Java 11 |
TESTS |
2 |
155 |
0 |
|
|
116433341 |
teenGraph |
A |
May 16, 2021, 7:55 p.m. |
OK |
Java 11 |
TESTS |
2 |
155 |
0 |
|
|
116431028 |
tishrah_ |
A |
May 16, 2021, 7:04 p.m. |
OK |
Java 11 |
TESTS |
2 |
155 |
0 |
|
|
116428625 |
less_ordinary |
A |
May 16, 2021, 6:21 p.m. |
OK |
Java 8 |
TESTS |
2 |
62 |
0 |
|
|
116395625 |
tarun8299 |
A |
May 16, 2021, 11:22 a.m. |
OK |
Java 8 |
TESTS |
2 |
77 |
0 |
|
|
116388844 |
plemenite |
A |
May 16, 2021, 10:17 a.m. |
OK |
Java 8 |
TESTS |
2 |
77 |
0 |
|
|
116390554 |
milestone101 |
A |
May 16, 2021, 10:31 a.m. |
OK |
Java 8 |
TESTS |
2 |
77 |
0 |
|
|
116443600 |
aljipa |
A |
May 17, 2021, 3:02 a.m. |
OK |
Java 8 |
TESTS |
2 |
77 |
0 |
|
|
116438559 |
littleCatLady |
A |
May 16, 2021, 11:19 p.m. |
OK |
Java 8 |
TESTS |
2 |
77 |
0 |
|
|
116435425 |
Agnimandur |
A |
May 16, 2021, 8:55 p.m. |
OK |
Java 8 |
TESTS |
2 |
77 |
0 |
|
|
116400285 |
Abhichauhan |
A |
May 16, 2021, 12:12 p.m. |
OK |
Java 8 |
TESTS |
2 |
77 |
0 |
|
|
116388272 |
amit_roy |
A |
May 16, 2021, 10:13 a.m. |
OK |
Java 8 |
TESTS |
2 |
92 |
0 |
|
|
116444136 |
bsaiteja35 |
A |
May 17, 2021, 3:17 a.m. |
OK |
Java 8 |
TESTS |
2 |
93 |
0 |
|
|
116438783 |
manohar_9 |
A |
May 16, 2021, 11:30 p.m. |
OK |
Kotlin |
TESTS |
2 |
93 |
0 |
|
|
116427198 |
kiel.dowdle |
A |
May 16, 2021, 5:56 p.m. |
OK |
Kotlin |
TESTS |
2 |
108 |
0 |
|
|
116389064 |
Spheniscine |
A |
May 16, 2021, 10:18 a.m. |
OK |
Kotlin |
TESTS |
2 |
108 |
0 |
|
|
116422801 |
koper |
A |
May 16, 2021, 4:47 p.m. |
OK |
Kotlin |
TESTS |
2 |
109 |
0 |
|
|
116397773 |
codersanjeev |
A |
May 16, 2021, 11:44 a.m. |
OK |
Kotlin |
TESTS |
2 |
109 |
0 |
|
|
116429708 |
wbars |
A |
May 16, 2021, 6:40 p.m. |
OK |
Kotlin |
TESTS |
2 |
155 |
1433600 |
|
|
116386706 |
TRR |
A |
May 16, 2021, 10:03 a.m. |
OK |
Mono C# |
TESTS |
2 |
30 |
0 |
|
|
116401597 |
_wsb_ |
A |
May 16, 2021, 12:26 p.m. |
OK |
MS C++ |
TESTS |
2 |
15 |
0 |
|
|
116401980 |
_wsb_ |
A |
May 16, 2021, 12:31 p.m. |
OK |
MS C++ |
TESTS |
2 |
15 |
0 |
|
|
116391782 |
wuhan0.0.0 |
A |
May 16, 2021, 10:43 a.m. |
OK |
MS C++ |
TESTS |
2 |
31 |
0 |
|
|
116409907 |
UnHingedFrog |
A |
May 16, 2021, 2:04 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
0 |
0 |
|
|
116418751 |
dingzhao777 |
A |
May 16, 2021, 3:50 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
15 |
0 |
|
|
116446186 |
cosinechicken |
A |
May 17, 2021, 4:07 a.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
15 |
0 |
|
|
116442793 |
Gosheri |
A |
May 17, 2021, 2:36 a.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
15 |
0 |
|
|
116427159 |
camacju |
A |
May 16, 2021, 5:55 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
15 |
0 |
|
|
116417053 |
nikhil_srivastava |
A |
May 16, 2021, 3:30 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
15 |
0 |
|
|
116416725 |
debendrakumar766 |
A |
May 16, 2021, 3:26 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
15 |
0 |
|
|
116413943 |
PANSG |
A |
May 16, 2021, 2:53 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
15 |
0 |
|
|
116402034 |
vjudge5 |
A |
May 16, 2021, 12:32 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
15 |
0 |
|
|
116399327 |
WoodMachine |
A |
May 16, 2021, 12:01 p.m. |
OK |
MS C++ 2017 |
TESTS |
2 |
15 |
0 |
|
|
116417336 |
Lap_Tapk |
A |
May 16, 2021, 3:33 p.m. |
OK |
.NET Core C# |
TESTS |
2 |
77 |
0 |
|
|
116386829 |
TheDesireToBelieve |
A |
May 16, 2021, 10:04 a.m. |
OK |
.NET Core C# |
TESTS |
2 |
77 |
0 |
|
|
116387010 |
TheDesireToBelieve |
A |
May 16, 2021, 10:05 a.m. |
OK |
.NET Core C# |
TESTS |
2 |
93 |
0 |
|
|
116390738 |
lukas_rimkus |
A |
May 16, 2021, 10:33 a.m. |
OK |
Node.js |
TESTS |
2 |
46 |
0 |
|
|
116434361 |
ayman1503 |
A |
May 16, 2021, 8:22 p.m. |
OK |
PHP |
TESTS |
2 |
31 |
0 |
|
|
116428340 |
whaleee |
A |
May 16, 2021, 6:16 p.m. |
OK |
PyPy 2 |
TESTS |
2 |
108 |
204800 |
|
|
116425695 |
surojit008 |
A |
May 16, 2021, 5:32 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
61 |
0 |
|
|
116436283 |
saurav_majoka |
A |
May 16, 2021, 9:28 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
77 |
0 |
|
|
116426447 |
puzzleVerma |
A |
May 16, 2021, 5:45 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
77 |
0 |
|
|
116429152 |
Hakiobo |
A |
May 16, 2021, 6:30 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
77 |
0 |
|
|
116451642 |
varsha765.vc |
A |
May 17, 2021, 5:53 a.m. |
OK |
PyPy 3 |
TESTS |
2 |
77 |
0 |
|
|
116445616 |
rvarian |
A |
May 17, 2021, 3:53 a.m. |
OK |
PyPy 3 |
TESTS |
2 |
77 |
0 |
|
|
116444530 |
kautilya |
A |
May 17, 2021, 3:27 a.m. |
OK |
PyPy 3 |
TESTS |
2 |
77 |
0 |
|
|
116440814 |
SewentySewen |
A |
May 17, 2021, 1:15 a.m. |
OK |
PyPy 3 |
TESTS |
2 |
77 |
0 |
|
|
116439759 |
BugLeave |
A |
May 17, 2021, 12:25 a.m. |
OK |
PyPy 3 |
TESTS |
2 |
77 |
0 |
|
|
116437401 |
Anshtyagi000 |
A |
May 16, 2021, 10:16 p.m. |
OK |
PyPy 3 |
TESTS |
2 |
77 |
0 |
|
|
116439560 |
Jaysonn |
A |
May 17, 2021, 12:15 a.m. |
OK |
Python 3 |
TESTS |
2 |
31 |
0 |
|
|
116424946 |
The_KingSlayer_ |
A |
May 16, 2021, 5:20 p.m. |
OK |
Python 3 |
TESTS |
2 |
31 |
0 |
|
|
116408650 |
Kaatil |
A |
May 16, 2021, 1:49 p.m. |
OK |
Python 3 |
TESTS |
2 |
31 |
0 |
|
|
116406537 |
AmbujBhaskar |
A |
May 16, 2021, 1:23 p.m. |
OK |
Python 3 |
TESTS |
2 |
31 |
0 |
|
|
116443040 |
LalithaSyamala |
A |
May 17, 2021, 2:44 a.m. |
OK |
Python 3 |
TESTS |
2 |
46 |
0 |
|
|
116446352 |
Ardeo1 |
A |
May 17, 2021, 4:11 a.m. |
OK |
Python 3 |
TESTS |
2 |
46 |
0 |
|
|
116445599 |
The_KingSlayer_ |
A |
May 17, 2021, 3:52 a.m. |
OK |
Python 3 |
TESTS |
2 |
46 |
0 |
|
|
116445420 |
The_KingSlayer_ |
A |
May 17, 2021, 3:48 a.m. |
OK |
Python 3 |
TESTS |
2 |
46 |
0 |
|
|
116445159 |
The_KingSlayer_ |
A |
May 17, 2021, 3:42 a.m. |
OK |
Python 3 |
TESTS |
2 |
46 |
0 |
|
|
116444861 |
alexeos30 |
A |
May 17, 2021, 3:35 a.m. |
OK |
Python 3 |
TESTS |
2 |
46 |
0 |
|
|
116416853 |
SaberXpro |
A |
May 16, 2021, 3:27 p.m. |
OK |
Rust |
TESTS |
2 |
15 |
0 |
|
|
116409454 |
TheSonOfRa |
A |
May 16, 2021, 1:58 p.m. |
OK |
Rust |
TESTS |
2 |
31 |
0 |
|
|
remove filters
Back to search problems