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
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
( 4023 ) |
L |
Lazyland |
PROGRAMMING |
|
|
1200 |
B'The kingdom of Lazyland is the home to n idlers. These idlers are incredibly lazy and create many problems to their ruler, the mighty King of Lazyland. Today k important jobs for the kingdom ( k <= n ) should be performed. Every job should be done by one person and every person can do at most one job. The King allowed every idler to choose one job they wanted to do and the i -th idler has chosen the job a_i . Unfortunately, some jobs may not be chosen by anyone, so the King has to persuade some idlers to choose another job. The King knows that it takes b_i minutes to persuade the i -th idler. He asked his minister of labour to calculate the minimum total time he needs to spend persuading the idlers to get all the jobs done. Can you help him? The first line of the input contains two integers n and k ( 1 <= k <= n <= 10^5 ) -- the number of idlers and the number of jobs. The second line of the input contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= k ) -- the jobs chosen by each idler. The third line of the input contains n integers b_1, b_2, ldots, b_n ( 1 <= b_i <= 10^9 ) -- the time the King needs to spend to persuade the i -th idler. The only line of the output should contain one number -- the minimum total time the King needs to spend persuading the idlers to get all the jobs done. In the first example the optimal plan is to persuade idlers 1, 6, and 8 to do jobs 2, 4, and 6. In the second example each job was chosen by some idler, so there is no need to persuade anyone. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
46693442 |
ruban |
L |
Dec. 6, 2018, 5:58 p.m. |
OK |
Delphi |
TESTS |
31 |
124 |
185651200 |
|
1200 |
46470532 |
TShT |
L |
Dec. 2, 2018, 7:22 a.m. |
OK |
FPC |
TESTS |
31 |
77 |
144281600 |
|
1200 |
46722701 |
vjudge3 |
L |
Dec. 7, 2018, 1:45 p.m. |
OK |
GNU C11 |
TESTS |
31 |
46 |
2048000 |
|
1200 |
46718113 |
vjudge3 |
L |
Dec. 7, 2018, 12:13 p.m. |
OK |
GNU C11 |
TESTS |
31 |
61 |
2048000 |
|
1200 |
46936162 |
vjudge2 |
L |
Dec. 12, 2018, 1:58 p.m. |
OK |
GNU C11 |
TESTS |
31 |
61 |
2457600 |
|
1200 |
46722439 |
vjudge3 |
L |
Dec. 7, 2018, 1:40 p.m. |
OK |
GNU C11 |
TESTS |
31 |
61 |
2457600 |
|
1200 |
46855572 |
RahmatyParsa |
L |
Dec. 10, 2018, 2:38 p.m. |
OK |
GNU C11 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
46476288 |
joylintp |
L |
Dec. 2, 2018, 8:11 a.m. |
OK |
GNU C11 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
50567172 |
NoSoul |
L |
Feb. 27, 2019, 1:39 p.m. |
OK |
GNU C11 |
TESTS |
31 |
62 |
1638400 |
|
1200 |
66366625 |
Razvan2000f |
L |
Dec. 5, 2019, 7:41 p.m. |
OK |
GNU C11 |
TESTS |
31 |
62 |
3993600 |
|
1200 |
46472097 |
Horcrux1729 |
L |
Dec. 2, 2018, 7:40 a.m. |
OK |
GNU C11 |
TESTS |
31 |
78 |
4812800 |
|
1200 |
46485837 |
sajalmkk jashn1234 naman1409 |
L |
Dec. 2, 2018, 9:35 a.m. |
OK |
GNU C11 |
TESTS |
31 |
78 |
5632000 |
|
1200 |
46567637 |
nn020701 |
L |
Dec. 4, 2018, 2:07 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
2048000 |
|
1200 |
46471906 |
LittleFairyKiki BadEnding |
L |
Dec. 2, 2018, 7:36 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
2252800 |
|
1200 |
48654590 |
ReaLNero1 |
L |
Jan. 21, 2019, 1:39 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
2252800 |
|
1200 |
46682333 |
Tgotp |
L |
Dec. 6, 2018, 12:37 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
3788800 |
|
1200 |
46473179 |
zero-based ddaydream suolun |
L |
Dec. 2, 2018, 7:50 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
31 |
5120000 |
|
1200 |
57734877 |
py_ultron |
L |
July 25, 2019, 9:38 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
46 |
1024000 |
|
1200 |
46843231 |
lsmll jiangshibiao lzw4896s |
L |
Dec. 10, 2018, 9:11 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
46 |
1126400 |
|
1200 |
46578408 |
08163268 |
L |
Dec. 4, 2018, 10:03 a.m. |
OK |
GNU C++11 |
TESTS |
31 |
46 |
1228800 |
|
1200 |
46562813 |
Ans_31 |
L |
Dec. 3, 2018, 7:34 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
46 |
1228800 |
|
1200 |
51259889 |
Wzy-XinYi |
L |
March 13, 2019, 12:53 p.m. |
OK |
GNU C++11 |
TESTS |
31 |
46 |
1433600 |
|
1200 |
46470404 |
NoBBok tokitsukaze kirisame |
L |
Dec. 2, 2018, 7:18 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
31 |
2355200 |
|
1200 |
46515321 |
tokitsukaze |
L |
Dec. 2, 2018, 3:48 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
46 |
2355200 |
|
1200 |
48591153 |
molamola. |
L |
Jan. 20, 2019, 2:24 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
46 |
4198400 |
|
1200 |
46470397 |
wleung_bvg |
L |
Dec. 2, 2018, 7:18 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
46 |
6553600 |
|
1200 |
64322861 |
kononovarseniy |
L |
Nov. 5, 2019, 4:15 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
61 |
1228800 |
|
1200 |
62966013 |
Mynesis |
L |
Oct. 20, 2019, 4:37 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
61 |
1740800 |
|
1200 |
59953021 |
XoM-B |
L |
Sept. 3, 2019, 3:08 p.m. |
OK |
GNU C++14 |
TESTS |
31 |
61 |
2662400 |
|
1200 |
46479427 |
usingtc |
L |
Dec. 2, 2018, 8:38 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
62 |
921600 |
|
1200 |
58199136 |
vjudge2 |
L |
Aug. 3, 2019, 2:55 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
46780401 |
drrrzdk |
L |
Dec. 9, 2018, 1:49 a.m. |
OK |
GNU C++14 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
46470457 |
noxwell KhaustovPavel Taube |
L |
Dec. 2, 2018, 7:20 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
46 |
2252800 |
|
1200 |
46474041 |
myHan acka1357 spectaclehong |
L |
Dec. 2, 2018, 7:56 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
61 |
1945600 |
|
1200 |
46494696 |
372561407 |
L |
Dec. 2, 2018, 10:16 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
61 |
3584000 |
|
1200 |
49894970 |
caiyiwen |
L |
Feb. 14, 2019, 6:27 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
62 |
819200 |
|
1200 |
50348218 |
vjudge1 |
L |
Feb. 23, 2019, 7:24 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
51850126 |
374272 |
L |
March 26, 2019, 7:27 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
61706990 |
A_root_A seehello |
L |
Oct. 2, 2019, 10:25 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
68648905 |
alexX512 Aleks5d Dan389 |
L |
Jan. 12, 2020, 10:03 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
46563395 |
NoDesire |
L |
Dec. 3, 2018, 8:01 p.m. |
OK |
GNU C++17 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
46633895 |
ainta |
L |
Dec. 5, 2018, 5:27 a.m. |
OK |
GNU C++17 |
TESTS |
31 |
62 |
1228800 |
|
1200 |
46721120 |
rupxup |
L |
Dec. 7, 2018, 1:13 p.m. |
OK |
Haskell |
TESTS |
31 |
872 |
48537600 |
|
1200 |
46474076 |
ankitssingh26 K_B_C_S arcus |
L |
Dec. 2, 2018, 7:56 a.m. |
OK |
Java 8 |
TESTS |
31 |
140 |
0 |
|
1200 |
46471238 |
tehqin |
L |
Dec. 2, 2018, 7:31 a.m. |
OK |
Java 8 |
TESTS |
31 |
156 |
0 |
|
1200 |
46470574 |
eatmore |
L |
Dec. 2, 2018, 7:23 a.m. |
OK |
Java 8 |
TESTS |
31 |
156 |
4300800 |
|
1200 |
58377641 |
garnacha |
L |
Aug. 6, 2019, 8:47 a.m. |
OK |
Java 8 |
TESTS |
31 |
171 |
0 |
|
1200 |
46511835 |
Conceal |
L |
Dec. 2, 2018, 1:42 p.m. |
OK |
Java 8 |
TESTS |
31 |
171 |
2867200 |
|
1200 |
46476126 |
wadissimo |
L |
Dec. 2, 2018, 8:07 a.m. |
OK |
Java 8 |
TESTS |
31 |
171 |
2969600 |
|
1200 |
46767409 |
Hemose |
L |
Dec. 8, 2018, 3:03 p.m. |
OK |
Java 8 |
TESTS |
31 |
171 |
3481600 |
|
1200 |
46565332 |
stolis |
L |
Dec. 3, 2018, 10:09 p.m. |
OK |
Java 8 |
TESTS |
31 |
171 |
5120000 |
|
1200 |
46487575 |
yellowjian |
L |
Dec. 2, 2018, 9:36 a.m. |
OK |
Java 8 |
TESTS |
31 |
171 |
5529600 |
|
1200 |
47853810 |
sooraj10 |
L |
Jan. 2, 2019, 7:41 p.m. |
OK |
Java 8 |
TESTS |
31 |
171 |
5939200 |
|
1200 |
46477996 |
moss3s |
L |
Dec. 2, 2018, 8:30 a.m. |
OK |
Kotlin |
TESTS |
31 |
295 |
10547200 |
|
1200 |
46512553 |
bubnov |
L |
Dec. 2, 2018, 2:05 p.m. |
OK |
Kotlin |
TESTS |
31 |
296 |
14438400 |
|
1200 |
69589004 |
arti |
L |
Jan. 26, 2020, 9:27 p.m. |
OK |
Kotlin |
TESTS |
31 |
373 |
9830400 |
|
1200 |
56645539 |
og.kostya |
L |
July 7, 2019, 6:14 a.m. |
OK |
Mono C# |
TESTS |
31 |
78 |
7680000 |
|
1200 |
46747104 |
nastya1199 |
L |
Dec. 8, 2018, 7:23 a.m. |
OK |
Mono C# |
TESTS |
31 |
124 |
21299200 |
|
1200 |
46536464 |
treasuryonly |
L |
Dec. 3, 2018, 9:19 a.m. |
OK |
Mono C# |
TESTS |
31 |
140 |
21299200 |
|
1200 |
49456042 |
vjudge1 |
L |
Feb. 4, 2019, 10:17 a.m. |
OK |
MS C++ |
TESTS |
31 |
46 |
1740800 |
|
1200 |
49107305 |
vjudge1 |
L |
Jan. 28, 2019, 1:38 p.m. |
OK |
MS C++ |
TESTS |
31 |
61 |
1638400 |
|
1200 |
46530172 |
107th |
L |
Dec. 3, 2018, 4:23 a.m. |
OK |
MS C++ |
TESTS |
31 |
61 |
16793600 |
|
1200 |
49221425 |
XDKalia |
L |
Jan. 30, 2019, 7:23 p.m. |
OK |
MS C++ |
TESTS |
31 |
62 |
1331200 |
|
1200 |
49221453 |
vjudge5 |
L |
Jan. 30, 2019, 7:24 p.m. |
OK |
MS C++ |
TESTS |
31 |
62 |
1331200 |
|
1200 |
49389724 |
vjudge4 |
L |
Feb. 3, 2019, 9:08 a.m. |
OK |
MS C++ |
TESTS |
31 |
62 |
1843200 |
|
1200 |
47393361 |
RDplayer |
L |
Dec. 23, 2018, 9:33 a.m. |
OK |
MS C++ |
TESTS |
31 |
62 |
2048000 |
|
1200 |
49185325 |
vjudge3 |
L |
Jan. 30, 2019, 5:37 a.m. |
OK |
MS C++ |
TESTS |
31 |
62 |
36044800 |
|
1200 |
50274781 |
vjudge3 |
L |
Feb. 21, 2019, 9:23 a.m. |
OK |
MS C++ |
TESTS |
31 |
77 |
2457600 |
|
1200 |
50704173 |
vjudge5 |
L |
March 3, 2019, 2:09 a.m. |
OK |
MS C++ |
TESTS |
31 |
77 |
2662400 |
|
1200 |
65573745 |
shef_2318 Ancient_mage vitux |
L |
Nov. 23, 2019, 8:41 a.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
171 |
4300800 |
|
1200 |
60697876 |
Phantom_ |
L |
Sept. 16, 2019, 8:46 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
202 |
1638400 |
|
1200 |
63240207 |
hi_allerria |
L |
Oct. 23, 2019, 1:16 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
202 |
6963200 |
|
1200 |
64681219 |
hi_allerria |
L |
Nov. 11, 2019, 10:05 a.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
202 |
6963200 |
|
1200 |
65306836 |
Sl07h |
L |
Nov. 18, 2019, 3:12 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
218 |
6246400 |
|
1200 |
63666974 |
xfd1048577 |
L |
Oct. 28, 2019, 3:39 p.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
265 |
6656000 |
|
1200 |
60987789 |
Sanqer WoodMachine beautifulsmile |
L |
Sept. 21, 2019, 8:14 a.m. |
OK |
MS C++ 2017 |
TESTS |
31 |
1185 |
1843200 |
|
1200 |
46538086 |
mayakin |
L |
Dec. 3, 2018, 10:17 a.m. |
OK |
PHP |
TESTS |
31 |
358 |
33177600 |
|
1200 |
46471851 |
sarthakmanna avijit_agarwal meooow |
L |
Dec. 2, 2018, 7:35 a.m. |
OK |
PyPy 2 |
TESTS |
31 |
202 |
14028800 |
|
1200 |
46716783 |
rohitbro |
L |
Dec. 7, 2018, 11:39 a.m. |
OK |
PyPy 2 |
TESTS |
31 |
233 |
12902400 |
|
1200 |
46773861 |
wol |
L |
Dec. 8, 2018, 6:43 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
264 |
15564800 |
|
1200 |
46907366 |
mikelopster |
L |
Dec. 11, 2018, 2:58 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
280 |
16384000 |
|
1200 |
46821298 |
kaname_madoka123 |
L |
Dec. 9, 2018, 3:27 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
311 |
18944000 |
|
1200 |
46483599 |
chandak_vikas |
L |
Dec. 2, 2018, 9:16 a.m. |
OK |
PyPy 3 |
TESTS |
31 |
312 |
18227200 |
|
1200 |
65942444 |
vlad927 |
L |
Nov. 29, 2019, 6:59 a.m. |
OK |
PyPy 3 |
TESTS |
31 |
342 |
15769600 |
|
1200 |
46479373 |
AShukhman |
L |
Dec. 2, 2018, 8:36 a.m. |
OK |
PyPy 3 |
TESTS |
31 |
358 |
16384000 |
|
1200 |
47622261 |
saku7 |
L |
Dec. 28, 2018, 1:22 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
389 |
15769600 |
|
1200 |
69251337 |
maerk |
L |
Jan. 21, 2020, 2:22 p.m. |
OK |
PyPy 3 |
TESTS |
31 |
592 |
17510400 |
|
1200 |
55542982 |
vjudge2 |
L |
June 13, 2019, 9:42 p.m. |
OK |
Python 2 |
TESTS |
31 |
327 |
7782400 |
|
1200 |
55814251 |
vjudge3 |
L |
June 20, 2019, 5:39 a.m. |
OK |
Python 2 |
TESTS |
31 |
327 |
7884800 |
|
1200 |
55814213 |
afranioag |
L |
June 20, 2019, 5:38 a.m. |
OK |
Python 2 |
TESTS |
31 |
327 |
7884800 |
|
1200 |
69911770 |
soumyasarkar1998 |
L |
Jan. 31, 2020, 3:35 p.m. |
OK |
Python 2 |
TESTS |
31 |
358 |
7884800 |
|
1200 |
55872949 |
vjudge4 |
L |
June 21, 2019, 3:46 p.m. |
OK |
Python 2 |
TESTS |
31 |
467 |
14438400 |
|
1200 |
46470193 |
ManasG ak532 harshits2808 |
L |
Dec. 2, 2018, 7:09 a.m. |
OK |
Python 2 |
TESTS |
31 |
592 |
15667200 |
|
1200 |
58414487 |
franckmy |
L |
Aug. 7, 2019, 3:53 a.m. |
OK |
Python 3 |
TESTS |
31 |
249 |
11264000 |
|
1200 |
54397651 |
gitarist |
L |
May 19, 2019, 9:55 p.m. |
OK |
Python 3 |
TESTS |
31 |
249 |
11264000 |
|
1200 |
54505859 |
tagun1202 |
L |
May 23, 2019, 3:42 a.m. |
OK |
Python 3 |
TESTS |
31 |
249 |
11366400 |
|
1200 |
46550964 |
llllllll |
L |
Dec. 3, 2018, 5:49 p.m. |
OK |
Python 3 |
TESTS |
31 |
264 |
10649600 |
|
1200 |
53973098 |
chauhain |
L |
May 11, 2019, 1:13 a.m. |
OK |
Python 3 |
TESTS |
31 |
264 |
11264000 |
|
1200 |
69931178 |
MAK18 |
L |
Jan. 31, 2020, 11:55 p.m. |
OK |
Python 3 |
TESTS |
31 |
264 |
11366400 |
|
1200 |
55486518 |
another_strike |
L |
June 12, 2019, 8:08 a.m. |
OK |
Python 3 |
TESTS |
31 |
264 |
14233600 |
|
1200 |
46507526 |
twoeight |
L |
Dec. 2, 2018, 11:48 a.m. |
OK |
Python 3 |
TESTS |
31 |
265 |
11673600 |
|
1200 |
46692541 |
chungonion |
L |
Dec. 6, 2018, 5:27 p.m. |
OK |
Python 3 |
TESTS |
31 |
265 |
12390400 |
|
1200 |
46494809 |
divyesh599 |
L |
Dec. 2, 2018, 10:18 a.m. |
OK |
Python 3 |
TESTS |
31 |
265 |
13004800 |
|
1200 |
46785788 |
koneko |
L |
Dec. 9, 2018, 6:21 a.m. |
OK |
Rust |
TESTS |
31 |
31 |
4915200 |
|
1200 |
47020233 |
hot_yoghurt |
L |
Dec. 15, 2018, 12:01 a.m. |
OK |
Scala |
TESTS |
31 |
1247 |
45260800 |
|
1200 |
46712467 |
|
L |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
46711926 |
|
L |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
46711846 |
|
L |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
46711711 |
|
L |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
46711535 |
|
L |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
46711445 |
|
L |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
46711351 |
|
L |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
46711077 |
|
L |
Dec. 7, 2018, 9:06 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
46711026 |
|
L |
Dec. 7, 2018, 9:05 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
46710915 |
|
L |
Dec. 7, 2018, 9:05 a.m. |
OK |
Unknown |
TESTS |
0 |
0 |
0 |
|
1200 |
remove filters
Back to search problems