Codeforces Round 501 (Div. 3)

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.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1015 Codeforces Round 501 (Div. 3) FINISHED False 7200 204477923 July 31, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18435 ) C Songs Compression PROGRAMMING sortings 1100

B'Ivan has n songs on his phone. The size of the i -th song is a_i bytes. Ivan also has a flash drive which can hold at most m bytes in total. Initially, his flash drive is empty. Ivan wants to copy all n songs to the flash drive. He can compress the songs. If he compresses the i -th song, the size of the i -th song reduces from a_i to b_i bytes ( b_i < a_i ). Ivan can compress any subset of the songs (possibly empty) and copy all the songs to his flash drive if the sum of their sizes is at most m . He can compress any subset of the songs (not necessarily contiguous). Ivan wants to find the minimum number of songs he needs to compress in such a way that all his songs fit on the drive (i.e. the sum of their sizes is less than or equal to m ). If it is impossible to copy all the songs (even if Ivan compresses all the songs), print "-1". Otherwise print the minimum number of songs Ivan needs to compress. The first line of the input contains two integers n and m ( 1 <= n <= 10^5, 1 <= m <= 10^9 ) -- the number of the songs on Ivan 's phone and the capacity of Ivan 's flash drive. The next n lines contain two integers each: the i -th line contains two integers a_i and b_i ( 1 <= a_i, b_i <= 10^9 , a_i > b_i ) -- the initial size of the i -th song and the size of the i -th song after compression. If it is impossible to compress a subset of the songs in such a way that all songs fit on the flash drive, print "-1". Otherwise print the minimum number of the songs to compress. In the first example Ivan can compress the first and the third songs so after these moves the sum of sizes will be equal to 8 + 7 + 1 + 5 = 21 <= 21 . Also Ivan can compress the first and the second songs, then the sum of sizes will be equal 8 + 4 + 3 + 5 = 20 <= 21 . Note that compressing any single song is not sufficient to copy all the songs on the flash'...

Tutorials

60949

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41529143 rr_ C Aug. 12, 2018, 1:35 p.m. OK D TESTS 25 155 4608000 1100
41529184 rr_ C Aug. 12, 2018, 1:36 p.m. OK D TESTS 25 155 4608000 1100
41092473 Proskurnikov C Aug. 1, 2018, 5:24 p.m. OK Delphi TESTS 25 46 716800 1100
41259303 chinahhy C Aug. 6, 2018, 1:08 a.m. OK FPC TESTS 25 62 512000 1100
41146364 TSFH C Aug. 3, 2018, 6:46 a.m. OK FPC TESTS 25 62 1331200 1100
41198668 BattleCry C Aug. 4, 2018, 3:30 a.m. OK FPC TESTS 25 62 1331200 1100
44480164 chaorenhaha C Oct. 18, 2018, 9:50 a.m. OK FPC TESTS 25 62 2457600 1100
44480138 chaorenhaha C Oct. 18, 2018, 9:50 a.m. OK FPC TESTS 25 62 3584000 1100
44480179 chaorenhaha C Oct. 18, 2018, 9:51 a.m. OK FPC TESTS 25 77 8089600 1100
41247688 LeVanThuc C Aug. 5, 2018, 2:06 p.m. OK FPC TESTS 25 78 1331200 1100
41657883 AsadulHasan_Rasel C Aug. 16, 2018, 3:57 p.m. OK GNU C TESTS 25 46 409600 1100
41223018 linesekarenge C Aug. 4, 2018, 5:17 p.m. OK GNU C TESTS 25 61 1228800 1100
41394203 tanvirbd C Aug. 9, 2018, 10:03 a.m. OK GNU C TESTS 25 61 1536000 1100
42069490 kara42 C Aug. 24, 2018, 10:16 p.m. OK GNU C TESTS 25 62 409600 1100
41445374 Gompu123 C Aug. 10, 2018, 10:56 p.m. OK GNU C TESTS 25 62 409600 1100
41154035 RenKai_Z C Aug. 3, 2018, 10:53 a.m. OK GNU C TESTS 25 62 409600 1100
41680891 griez7 C Aug. 17, 2018, 10:53 a.m. OK GNU C TESTS 25 62 819200 1100
42275896 biswajit_saha C Aug. 30, 2018, 11:28 a.m. OK GNU C TESTS 25 62 1228800 1100
41133823 anascimento C Aug. 2, 2018, 7:11 p.m. OK GNU C TESTS 25 62 1638400 1100
41111865 lokianyu C Aug. 2, 2018, 7:10 a.m. OK GNU C TESTS 25 78 1638400 1100
42228661 vjudge5 C Aug. 29, 2018, 5:09 a.m. OK GNU C++ TESTS 25 46 204800 1100
41648014 lwl520 C Aug. 16, 2018, 9:53 a.m. OK GNU C++ TESTS 25 46 204800 1100
41102622 suxuyu01 C Aug. 2, 2018, 1:59 a.m. OK GNU C++ TESTS 25 46 409600 1100
42012726 vjudge1 C Aug. 24, 2018, 2:58 a.m. OK GNU C++ TESTS 25 46 409600 1100
41611119 vjudge5 C Aug. 15, 2018, 6:29 a.m. OK GNU C++ TESTS 25 46 409600 1100
41337414 vjudge2 C Aug. 8, 2018, 1:02 p.m. OK GNU C++ TESTS 25 46 409600 1100
41236638 Scut82 C Aug. 5, 2018, 7:38 a.m. OK GNU C++ TESTS 25 46 409600 1100
41100737 little_sun C Aug. 2, 2018, 12:47 a.m. OK GNU C++ TESTS 25 46 409600 1100
41100735 little_sun C Aug. 2, 2018, 12:47 a.m. OK GNU C++ TESTS 25 46 409600 1100
41926655 vjudge4 C Aug. 21, 2018, 7:50 a.m. OK GNU C++ TESTS 25 46 819200 1100
52513488 sansen C April 9, 2019, 2:36 a.m. OK GNU C11 TESTS 25 31 409600 1100
64491181 vjudge3 C Nov. 7, 2019, 8:03 p.m. OK GNU C11 TESTS 25 46 409600 1100
64491151 Yulina C Nov. 7, 2019, 8:02 p.m. OK GNU C11 TESTS 25 46 409600 1100
59710567 You_Know_Who C Aug. 30, 2019, 2:30 p.m. OK GNU C11 TESTS 25 46 819200 1100
65504551 DevJewel C Nov. 21, 2019, 9:08 p.m. OK GNU C11 TESTS 25 61 409600 1100
53016932 Felix555 C April 19, 2019, 2:35 p.m. OK GNU C11 TESTS 25 61 409600 1100
41231598 SciVec C Aug. 5, 2018, 3:35 a.m. OK GNU C11 TESTS 25 62 819200 1100
58690159 wander_dog C Aug. 13, 2019, 2:42 a.m. OK GNU C11 TESTS 25 62 1228800 1100
46364967 NoSoul C Nov. 29, 2018, 12:50 p.m. OK GNU C11 TESTS 25 62 1228800 1100
51787805 akash19jain C March 24, 2019, 11:27 a.m. OK GNU C11 TESTS 25 62 2355200 1100
41408177 qeatzy C Aug. 9, 2018, 6:05 p.m. OK GNU C++11 TESTS 25 31 409600 1100
55235497 Umi C June 7, 2019, 8:12 a.m. OK GNU C++11 TESTS 25 31 819200 1100
41216483 tokitsukaze C Aug. 4, 2018, 1:15 p.m. OK GNU C++11 TESTS 25 31 921600 1100
41095907 ReaLNero1 C Aug. 1, 2018, 7:31 p.m. OK GNU C++11 TESTS 25 31 1024000 1100
41148787 hjw C Aug. 3, 2018, 7:49 a.m. OK GNU C++11 TESTS 25 31 1126400 1100
41422933 DragoonKiller C Aug. 10, 2018, 7:56 a.m. OK GNU C++11 TESTS 25 31 1126400 1100
42786949 yjyzforever C Sept. 12, 2018, 5:14 a.m. OK GNU C++11 TESTS 25 31 1638400 1100
50891451 luogu_bot4 C March 6, 2019, 1:20 p.m. OK GNU C++11 TESTS 25 31 1638400 1100
56604440 penn20090403 C July 6, 2019, 3:22 a.m. OK GNU C++11 TESTS 25 46 409600 1100
56604391 luogu_bot3 C July 6, 2019, 3:20 a.m. OK GNU C++11 TESTS 25 46 409600 1100
50592430 vjudge5 C Feb. 28, 2019, 8:14 a.m. OK GNU C++14 TESTS 25 46 1228800 1100
47877928 smsm8111 C Jan. 3, 2019, 4:32 p.m. OK GNU C++14 TESTS 25 46 1433600 1100
41578691 OgataRina C Aug. 14, 2018, 6:51 a.m. OK GNU C++14 TESTS 25 46 1638400 1100
41140997 hdu17jealous C Aug. 3, 2018, 2:52 a.m. OK GNU C++14 TESTS 25 46 2355200 1100
50593522 vjudge5 C Feb. 28, 2019, 8:51 a.m. OK GNU C++14 TESTS 25 46 24064000 1100
64582036 Mohamed_Saad62 C Nov. 9, 2019, 12:22 p.m. OK GNU C++14 TESTS 25 61 409600 1100
47299366 vjudge3 C Dec. 20, 2018, 1:29 p.m. OK GNU C++14 TESTS 25 61 409600 1100
47877294 rlj1202 C Jan. 3, 2019, 4:10 p.m. OK GNU C++14 TESTS 25 61 409600 1100
50529792 vjudge5 C Feb. 26, 2019, 1:12 p.m. OK GNU C++14 TESTS 25 61 409600 1100
47876899 threepebbles C Jan. 3, 2019, 3:57 p.m. OK GNU C++14 TESTS 25 61 614400 1100
56813435 Thanya_Leif C July 10, 2019, 5:37 p.m. OK GNU C++17 TESTS 25 46 1126400 1100
67659126 Ghozlan C Dec. 26, 2019, 3:03 p.m. OK GNU C++17 TESTS 25 46 1126400 1100
49447767 wdyd2004 dreamr C Feb. 4, 2019, 4:47 a.m. OK GNU C++17 TESTS 25 46 2355200 1100
56604032 zhuzhu2007 C July 6, 2019, 3:05 a.m. OK GNU C++17 TESTS 25 61 409600 1100
51618585 Edwivv C March 21, 2019, 1:25 p.m. OK GNU C++17 TESTS 25 61 409600 1100
47790395 MADKIRUS C Dec. 31, 2018, 1:01 p.m. OK GNU C++17 TESTS 25 61 409600 1100
46538057 STZG C Dec. 3, 2018, 10:15 a.m. OK GNU C++17 TESTS 25 61 409600 1100
41111029 stArliGht C Aug. 2, 2018, 6:48 a.m. OK GNU C++17 TESTS 25 61 716800 1100
47332882 Lucina C Dec. 21, 2018, 1:45 p.m. OK GNU C++17 TESTS 25 61 819200 1100
41803999 _SOCIOPATH C Aug. 18, 2018, 8:21 p.m. OK GNU C++17 TESTS 25 61 819200 1100
41636234 synapse C Aug. 16, 2018, 12:32 a.m. OK Go TESTS 25 46 5324800 1100
41636348 synapse C Aug. 16, 2018, 12:39 a.m. OK Go TESTS 25 46 5324800 1100
41636217 synapse C Aug. 16, 2018, 12:29 a.m. OK Go TESTS 25 61 5324800 1100
41636386 synapse C Aug. 16, 2018, 12:43 a.m. OK Go TESTS 25 61 5427200 1100
41734196 synapse C Aug. 18, 2018, 1:19 a.m. OK Go TESTS 25 187 3276800 1100
41628452 synapse C Aug. 15, 2018, 4:13 p.m. OK Go TESTS 25 202 3276800 1100
41734224 synapse C Aug. 18, 2018, 1:20 a.m. OK Go TESTS 25 202 3379200 1100
42317399 kv7 C Aug. 31, 2018, 6:20 p.m. OK Go TESTS 25 202 4710400 1100
42017147 Marii C Aug. 24, 2018, 7 a.m. OK Go TESTS 25 218 4710400 1100
41526410 tusupov C Aug. 12, 2018, 12:10 p.m. OK Go TESTS 25 218 4812800 1100
69667105 GiantTornado C Jan. 28, 2020, 11:45 a.m. OK Java 11 TESTS 25 233 0 1100
66415883 abdallahsameh C Dec. 6, 2019, 5:04 p.m. OK Java 11 TESTS 25 467 0 1100
64335946 pizzaEater C Nov. 5, 2019, 9:54 p.m. OK Java 11 TESTS 25 529 0 1100
68881430 MahmoudJobeel C Jan. 15, 2020, 6:59 p.m. OK Java 8 TESTS 25 139 0 1100
66253673 bluesky111 C Dec. 4, 2019, 4:26 a.m. OK Java 8 TESTS 25 140 0 1100
67041709 Ziklon C Dec. 16, 2019, 7:36 p.m. OK Java 8 TESTS 25 140 0 1100
62322181 georgio0324 C Oct. 10, 2019, 5:06 p.m. OK Java 8 TESTS 25 140 0 1100
56030450 foreverlearner C June 25, 2019, 9:15 a.m. OK Java 8 TESTS 25 140 0 1100
41115220 antkhorin C Aug. 2, 2018, 8:40 a.m. OK Java 8 TESTS 25 140 0 1100
48457509 Naman_123 C Jan. 16, 2019, 1:12 p.m. OK Java 8 TESTS 25 155 0 1100
58228434 insane_28 C Aug. 3, 2019, 3:33 p.m. OK Java 8 TESTS 25 155 0 1100
51120563 Piccadilly C March 10, 2019, 9:01 a.m. OK Java 8 TESTS 25 155 0 1100
64707679 arsh1598 C Nov. 11, 2019, 5:13 p.m. OK Java 8 TESTS 25 155 0 1100
53308448 vjudge2 C April 26, 2019, 4:43 a.m. OK Kotlin TESTS 25 389 0 1100
41508768 camoroh13 C Aug. 11, 2018, 11:57 p.m. OK Kotlin TESTS 25 389 1228800 1100
54492602 og.kostya C May 22, 2019, 4:09 p.m. OK Mono C# TESTS 25 46 819200 1100
41218137 keep.deep C Aug. 4, 2018, 2:06 p.m. OK Mono C# TESTS 25 109 3481600 1100
43139374 mp913 C Sept. 20, 2018, 3:57 p.m. OK Mono C# TESTS 25 109 3891200 1100
61194159 aleks180700 C Sept. 24, 2019, 4:40 a.m. OK Mono C# TESTS 25 124 3481600 1100
41601611 Mosyagin C Aug. 14, 2018, 8:38 p.m. OK Mono C# TESTS 25 124 4300800 1100
41592399 n.a.borisov C Aug. 14, 2018, 2:49 p.m. OK Mono C# TESTS 25 124 4300800 1100
42120033 TrinidadTobago C Aug. 26, 2018, 11:58 a.m. OK Mono C# TESTS 25 124 9011200 1100
44746356 v_p C Oct. 23, 2018, 5:06 p.m. OK Mono C# TESTS 25 139 7680000 1100
44746286 v_p C Oct. 23, 2018, 5:04 p.m. OK Mono C# TESTS 25 139 7680000 1100
41136699 Seva C Aug. 2, 2018, 9:36 p.m. OK Mono C# TESTS 25 140 5529600 1100
44527360 vjudge4 C Oct. 19, 2018, 3:59 a.m. OK MS C++ TESTS 25 46 409600 1100
59000146 vjudge1 C Aug. 18, 2019, 1:21 p.m. OK MS C++ TESTS 25 46 409600 1100
51558718 vjudge4 C March 20, 2019, 6:56 a.m. OK MS C++ TESTS 25 46 409600 1100
49528405 vjudge2 C Feb. 6, 2019, 12:40 p.m. OK MS C++ TESTS 25 46 409600 1100
42227097 vjudge5 C Aug. 29, 2018, 3:36 a.m. OK MS C++ TESTS 25 46 614400 1100
42662146 lavki_Lenu_Ivanovu C Sept. 8, 2018, 5:22 a.m. OK MS C++ TESTS 25 46 614400 1100
58644999 vjudge5 C Aug. 12, 2019, 5:25 a.m. OK MS C++ TESTS 25 46 819200 1100
57980480 vjudge5 C July 30, 2019, 9:12 a.m. OK MS C++ TESTS 25 46 1228800 1100
55084536 vjudge2 C June 4, 2019, 12:04 p.m. OK MS C++ TESTS 25 46 1228800 1100
55081368 vjudge1 C June 4, 2019, 10:52 a.m. OK MS C++ TESTS 25 46 1228800 1100
59068683 vjudge2 C Aug. 19, 2019, 3:19 a.m. OK MS C++ 2017 TESTS 25 78 819200 1100
54423001 HHHEN C May 20, 2019, 4:36 p.m. OK MS C++ 2017 TESTS 25 78 819200 1100
51117301 NPUlzh C March 10, 2019, 7:34 a.m. OK MS C++ 2017 TESTS 25 78 819200 1100
69873939 vjudge2 C Jan. 31, 2020, 2:41 a.m. OK MS C++ 2017 TESTS 25 78 1433600 1100
55520193 hwangganzi C June 13, 2019, 8:03 a.m. OK MS C++ 2017 TESTS 25 93 5734400 1100
63117285 tanimania C Oct. 22, 2019, 9:50 a.m. OK MS C++ 2017 TESTS 25 171 1843200 1100
57704127 IbraheemJanajreh C July 24, 2019, 7:07 p.m. OK MS C++ 2017 TESTS 25 186 409600 1100
61544786 moh.om.ha C Sept. 30, 2019, 9:56 a.m. OK MS C++ 2017 TESTS 25 186 1638400 1100
57637561 jjang36524 C July 24, 2019, 11:24 a.m. OK MS C++ 2017 TESTS 25 187 409600 1100
63616687 ahmed963 C Oct. 27, 2019, 7:54 p.m. OK MS C++ 2017 TESTS 25 187 2457600 1100
49527851 vjudge1 C Feb. 6, 2019, 12:22 p.m. OK Node.js TESTS 25 389 21708800 1100
48497157 KOLASKA C Jan. 17, 2019, 1:27 p.m. OK PascalABC.NET TESTS 25 482 307200 1100
48502722 Daimos C Jan. 17, 2019, 4 p.m. OK PascalABC.NET TESTS 25 514 5632000 1100
48494419 Ms_butovchenko C Jan. 17, 2019, 12:22 p.m. OK PascalABC.NET TESTS 25 529 409600 1100
42129119 mayakin C Aug. 26, 2018, 5:14 p.m. OK PHP TESTS 25 124 18432000 1100
54820902 Mukundan314 C May 30, 2019, 2:34 a.m. OK PyPy 2 TESTS 25 187 10137600 1100
45432792 c1729 leo7279 C Nov. 8, 2018, 5:41 a.m. OK PyPy 2 TESTS 25 202 12800000 1100
45182534 noob77777 C Nov. 1, 2018, 5:56 p.m. OK PyPy 2 TESTS 25 358 6246400 1100
41123269 arikpamnani C Aug. 2, 2018, 1:01 p.m. OK PyPy 2 TESTS 25 545 7987200 1100
41310046 kd710306 C Aug. 7, 2018, 3:24 p.m. OK PyPy 2 TESTS 25 546 7577600 1100
42451579 morejarphone C Sept. 4, 2018, 8:29 a.m. OK PyPy 2 TESTS 25 592 4812800 1100
45182359 noob77777 C Nov. 1, 2018, 5:50 p.m. OK PyPy 2 TESTS 25 670 7987200 1100
53492457 yfo C April 29, 2019, 9:37 a.m. OK PyPy 3 TESTS 25 296 9011200 1100
42486382 wadissimo C Sept. 5, 2018, 9:19 a.m. OK PyPy 3 TESTS 25 311 8499200 1100
56556684 koptev C July 5, 2019, 12:43 p.m. OK PyPy 3 TESTS 25 358 10547200 1100
50506521 schiebermc C Feb. 25, 2019, 8:07 p.m. OK PyPy 3 TESTS 25 467 16793600 1100
41408219 CyberHood C Aug. 9, 2018, 6:07 p.m. OK PyPy 3 TESTS 25 514 12902400 1100
41090755 swguy C Aug. 1, 2018, 4:31 p.m. OK PyPy 3 TESTS 25 842 9728000 1100
41224917 mohammedawni C Aug. 4, 2018, 7:03 p.m. OK PyPy 3 TESTS 25 857 9830400 1100
41113743 LordVader C Aug. 2, 2018, 8 a.m. OK PyPy 3 TESTS 25 873 9625600 1100
67014770 Pechalka C Dec. 16, 2019, 11:07 a.m. OK PyPy 3 TESTS 25 888 9625600 1100
41168144 arknave C Aug. 3, 2018, 3:13 p.m. OK PyPy 3 TESTS 25 888 9728000 1100
45889103 alwaysavani C Nov. 17, 2018, 5:41 p.m. OK Python 2 TESTS 25 405 6656000 1100
45182509 noob77777 C Nov. 1, 2018, 5:55 p.m. OK Python 2 TESTS 25 420 4300800 1100
47351455 biltharesatyendra C Dec. 22, 2018, 3:13 a.m. OK Python 2 TESTS 25 420 4505600 1100
41894847 bit10011001 C Aug. 20, 2018, 8:54 a.m. OK Python 2 TESTS 25 421 4198400 1100
41143782 rakshak197 C Aug. 3, 2018, 5:25 a.m. OK Python 2 TESTS 25 452 4710400 1100
41115023 franckmy C Aug. 2, 2018, 8:35 a.m. OK Python 2 TESTS 25 483 3276800 1100
41154777 SoSooding C Aug. 3, 2018, 11:23 a.m. OK Python 2 TESTS 25 483 4198400 1100
41319115 vjudge4 C Aug. 7, 2018, 10:35 p.m. OK Python 2 TESTS 25 483 8396800 1100
43745526 Quirinius C Oct. 3, 2018, 8:30 p.m. OK Python 2 TESTS 25 483 9932800 1100
43273138 luisalcantara C Sept. 22, 2018, 8:17 p.m. OK Python 2 TESTS 25 483 11468800 1100
45957090 Annvv C Nov. 19, 2018, 9:49 a.m. OK Python 3 TESTS 25 280 3379200 1100
41131799 orailly C Aug. 2, 2018, 5:52 p.m. OK Python 3 TESTS 25 311 7680000 1100
45671955 r57shell C Nov. 13, 2018, 11:10 a.m. OK Python 3 TESTS 25 343 2867200 1100
41095511 sergovoy C Aug. 1, 2018, 7:14 p.m. OK Python 3 TESTS 25 343 20889600 1100
45700924 bergus C Nov. 14, 2018, 8:10 a.m. OK Python 3 TESTS 25 358 2969600 1100
63129265 sudhan247 C Oct. 22, 2019, 1:42 p.m. OK Python 3 TESTS 25 358 14131200 1100
68390786 MEJlAHXOJluK C Jan. 8, 2020, 8:32 a.m. OK Python 3 TESTS 25 374 2867200 1100
52381950 MidAndFeed C April 6, 2019, 10:31 a.m. OK Python 3 TESTS 25 374 3072000 1100
66609784 octocoder C Dec. 10, 2019, 8:40 p.m. OK Python 3 TESTS 25 374 6860800 1100
54862156 disby C May 31, 2019, 3:13 a.m. OK Python 3 TESTS 25 389 2355200 1100
58634052 garel254 C Aug. 11, 2019, 10:15 p.m. OK Ruby TESTS 25 436 1536000 1100
41310425 clupasq C Aug. 7, 2018, 3:41 p.m. OK Ruby TESTS 25 467 1433600 1100
41148213 betrue12 C Aug. 3, 2018, 7:35 a.m. OK Ruby TESTS 25 483 3481600 1100
41824581 yakamoto C Aug. 19, 2018, 11:22 a.m. OK Scala TESTS 25 732 0 1100

remove filters

Back to search problems