Codeforces Round 165 (Div. 1)

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
269 Codeforces Round 165 (Div. 1) FINISHED False 7200 372090599 Feb. 1, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3535 ) A Magical Boxes PROGRAMMING greedy math 1700

B'Emuskald is a well-known illusionist. One of his trademark tricks involves a set of magical boxes. The essence of the trick is in packing the boxes inside other boxes. From the top view each magical box looks like a square with side length equal to 2k (k is an integer, k xe2 x80 x89 xe2 x89 xa5 xe2 x80 x890) units. A magical box v can be put inside a magical box u, if side length of v is strictly less than the side length of u. In particular, Emuskald can put 4 boxes of side length 2k xe2 x80 x89- xe2 x80 x891 into one box of side length 2k, or as in the following figure: Emuskald is about to go on tour performing around the world, and needs to pack his magical boxes for the trip. He has decided that the best way to pack them would be inside another magical box, but magical boxes are quite expensive to make. Help him find the smallest magical box that can fit all his boxes. The first line of input contains an integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105), the number of different sizes of boxes Emuskald has. Each of following n lines contains two integers ki and ai (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ki xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109), which means that Emuskald has ai boxes with side length 2ki. It is guaranteed that all of ki are distinct. Output a single integer p, such that the smallest magical box that can contain all of Emuskald xe2 x80 x99s boxes has side length 2p. Picture explanation. If we have 3 boxes with side length 2 and 5 boxes with side length 1, then we can put all these boxes inside a box with side length 4, for example, as shown in the picture. In the second test case, we can put all four small boxes into a box with side length 2.'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
3047019 Gassa A Feb. 1, 2013, 3:43 p.m. OK D TESTS 45 265 921600 1700
3047577 Misha100896 A Feb. 1, 2013, 3:46 p.m. OK Delphi TESTS 45 46 819200 1700
3050923 NickAltair A Feb. 1, 2013, 4:09 p.m. OK Delphi TESTS 45 46 1638400 1700
3049609 vilcheuski A Feb. 1, 2013, 3:59 p.m. OK Delphi TESTS 45 62 1740800 1700
3051494 IgorL A Feb. 1, 2013, 4:14 p.m. OK Delphi TESTS 45 62 3276800 1700
3063305 Shkiper A Feb. 2, 2013, 10:59 a.m. OK Delphi TESTS 45 78 0 1700
3059041 romanychda A Feb. 1, 2013, 6:26 p.m. OK Delphi TESTS 45 78 819200 1700
3048195 equi A Feb. 1, 2013, 3:50 p.m. OK Delphi TESTS 45 78 1638400 1700
3056978 Crysis A Feb. 1, 2013, 5:18 p.m. OK Delphi TESTS 45 93 16076800 1700
3062039 AleksanderBalobanov A Feb. 2, 2013, 6:57 a.m. OK Delphi TESTS 45 109 4915200 1700
3065870 ruban A Feb. 3, 2013, 2:11 a.m. OK Delphi TESTS 45 296 48025600 1700
3851731 _Mao_ A June 9, 2013, 6:22 p.m. OK FPC TESTS 46 62 0 1700
3070539 hxywtc A Feb. 4, 2013, 11:40 a.m. OK FPC TESTS 45 62 0 1700
3063539 Chen_ChaoRui A Feb. 2, 2013, 11:49 a.m. OK FPC TESTS 45 62 0 1700
3065255 doanminhdragon A Feb. 2, 2013, 6:13 p.m. OK FPC TESTS 45 62 102400 1700
3065250 doanminhdragon A Feb. 2, 2013, 6:11 p.m. OK FPC TESTS 45 62 102400 1700
5294898 bognden100w A Nov. 29, 2013, 3:25 p.m. OK FPC TESTS 46 62 819200 1700
3053181 Petrushenko A Feb. 1, 2013, 4:30 p.m. OK FPC TESTS 45 62 2560000 1700
3059928 no_space A Feb. 1, 2013, 7:42 p.m. OK FPC TESTS 45 78 0 1700
3075323 VitalijD A Feb. 5, 2013, 3:30 p.m. OK FPC TESTS 46 78 102400 1700
3170902 thaison1496 A Feb. 22, 2013, 7:08 a.m. OK FPC TESTS 46 78 819200 1700
4269790 adamant A Aug. 12, 2013, 1:43 p.m. OK GNU C TESTS 46 62 0 1700
3232187 vjudge3 A March 3, 2013, 3:03 a.m. OK GNU C TESTS 46 62 0 1700
3222537 vjudge4 A March 1, 2013, 5:35 a.m. OK GNU C TESTS 46 62 0 1700
3222525 pnging A March 1, 2013, 5:34 a.m. OK GNU C TESTS 46 62 0 1700
3058820 ali_fiujnomali A Feb. 1, 2013, 6:15 p.m. OK GNU C TESTS 45 62 0 1700
3207533 vjudge3 A Feb. 28, 2013, 1:38 p.m. OK GNU C TESTS 46 62 819200 1700
3067003 gbis36 A Feb. 3, 2013, 12:33 p.m. OK GNU C TESTS 45 62 819200 1700
3062573 hariprasath A Feb. 2, 2013, 8:29 a.m. OK GNU C TESTS 45 62 819200 1700
3062110 cpy A Feb. 2, 2013, 7:09 a.m. OK GNU C TESTS 45 62 819200 1700
3057432 gxnncrx1993 A Feb. 1, 2013, 5:23 p.m. OK GNU C TESTS 45 62 8908800 1700
3134822 enrevol A Feb. 15, 2013, 10:08 p.m. OK GNU C++ TESTS 46 15 0 1700
3046300 Leo_Yu A Feb. 1, 2013, 3:39 p.m. OK GNU C++ TESTS 45 15 0 1700
3071054 eddy1021 A Feb. 4, 2013, 1:51 p.m. OK GNU C++ TESTS 45 31 0 1700
3055736 sokian A Feb. 1, 2013, 5:04 p.m. OK GNU C++ TESTS 45 31 819200 1700
3050521 savinov A Feb. 1, 2013, 4:06 p.m. OK GNU C++ TESTS 45 31 819200 1700
3058324 bakabakashyoshyo A Feb. 1, 2013, 6 p.m. OK GNU C++ TESTS 45 31 15974400 1700
3063376 vjudge1 A Feb. 2, 2013, 11:11 a.m. OK GNU C++ TESTS 45 31 17612800 1700
3111603 Yukine_Chris A Feb. 13, 2013, 12:39 p.m. OK GNU C++ TESTS 46 46 0 1700
3724654 triple_e A May 15, 2013, 6:13 p.m. OK GNU C++ TESTS 46 46 0 1700
3228140 Tangjz A March 2, 2013, 4:48 a.m. OK GNU C++ TESTS 46 46 0 1700
3048421 andreyv A Feb. 1, 2013, 3:51 p.m. OK GNU C++0x TESTS 45 46 0 1700
3046673 gchebanov A Feb. 1, 2013, 3:41 p.m. OK GNU C++0x TESTS 45 46 0 1700
3071712 BJIAJL A Feb. 4, 2013, 4:38 p.m. OK GNU C++0x TESTS 45 62 0 1700
3061557 s-quark A Feb. 2, 2013, 5:09 a.m. OK GNU C++0x TESTS 45 62 0 1700
3047011 betalife37 A Feb. 1, 2013, 3:43 p.m. OK GNU C++0x TESTS 45 62 0 1700
3047085 Skird A Feb. 1, 2013, 3:43 p.m. OK GNU C++0x TESTS 45 62 0 1700
3072938 cylixstar A Feb. 5, 2013, 4:03 a.m. OK GNU C++0x TESTS 46 62 0 1700
3047489 Archon.JK A Feb. 1, 2013, 3:46 p.m. OK GNU C++0x TESTS 45 62 819200 1700
3046297 kinodjnz A Feb. 1, 2013, 3:39 p.m. OK GNU C++0x TESTS 45 62 819200 1700
7733676 chrome A Sept. 10, 2014, 9:13 a.m. OK GNU C++0x TESTS 46 62 2150400 1700
11928129 merolish A July 5, 2015, 12:12 a.m. OK GNU C11 TESTS 46 124 0 1700
58681054 rainboy A Aug. 12, 2019, 6:59 p.m. OK GNU C11 TESTS 46 124 819200 1700
11176081 xxxyyyzzz A May 20, 2015, 10:08 a.m. OK GNU C++11 TESTS 46 62 0 1700
21021437 habib_rahman A Sept. 30, 2016, 2:22 p.m. OK GNU C++11 TESTS 46 62 0 1700
62402316 vito0210 A Oct. 12, 2019, 7:48 a.m. OK GNU C++11 TESTS 46 62 0 1700
14429853 TheMaverick A Nov. 23, 2015, 4:34 p.m. OK GNU C++11 TESTS 46 62 819200 1700
28897503 Kuroni A July 26, 2017, 7:43 a.m. OK GNU C++11 TESTS 46 62 2048000 1700
17270977 TomBombadil A April 10, 2016, 7:57 p.m. OK GNU C++11 TESTS 46 92 0 1700
16728180 freebsdx A March 15, 2016, 1:50 p.m. OK GNU C++11 TESTS 46 92 0 1700
16216991 mostafa_thabet A Feb. 19, 2016, 9:41 p.m. OK GNU C++11 TESTS 46 92 0 1700
51507870 scientificuber A March 19, 2019, 3:19 p.m. OK GNU C++11 TESTS 46 92 0 1700
31047587 _QWOiNYUIVMPFSBKLiGSMAP_ A Oct. 5, 2017, 9:30 p.m. OK GNU C++11 TESTS 46 92 0 1700
29442824 LiChenKoh A Aug. 13, 2017, 7:58 p.m. OK GNU C++14 TESTS 46 30 1945600 1700
49230756 Anu_coder A Jan. 31, 2019, 5:13 a.m. OK GNU C++14 TESTS 46 92 204800 1700
28821984 _AjReme_ A July 24, 2017, 10:38 a.m. OK GNU C++14 TESTS 46 92 1945600 1700
25461783 Fischer A March 13, 2017, 8:24 p.m. OK GNU C++14 TESTS 46 92 2764800 1700
22698022 red_dust A Dec. 4, 2016, 2:54 p.m. OK GNU C++14 TESTS 46 122 0 1700
49230506 Anu_coder A Jan. 31, 2019, 4:59 a.m. OK GNU C++14 TESTS 46 122 0 1700
33647367 Harshad A Dec. 26, 2017, 1:04 p.m. OK GNU C++14 TESTS 46 122 1945600 1700
27767998 iit2015023 A June 14, 2017, 5:40 a.m. OK GNU C++14 TESTS 46 124 0 1700
42905278 Eddagdeg A Sept. 15, 2018, 11:59 p.m. OK GNU C++14 TESTS 46 124 0 1700
60894135 aniketpandey353 A Sept. 19, 2019, 6:01 p.m. OK GNU C++14 TESTS 46 124 0 1700
53862631 yuhta A May 7, 2019, 10:52 p.m. OK GNU C++17 TESTS 46 122 0 1700
51810205 ruo A March 25, 2019, 4:46 a.m. OK GNU C++17 TESTS 46 122 819200 1700
57181004 sammithkanur A July 17, 2019, 7:15 a.m. OK GNU C++17 TESTS 46 124 0 1700
45036404 Kisui_Pari_Na A Oct. 29, 2018, 7:58 a.m. OK GNU C++17 TESTS 46 124 307200 1700
47797748 mTvTm A Dec. 31, 2018, 6:39 p.m. OK GNU C++17 TESTS 46 124 819200 1700
38821792 gokul.raj A June 1, 2018, 8:04 a.m. OK GNU C++17 TESTS 46 124 3379200 1700
64659657 limabeans A Nov. 10, 2019, 8:27 p.m. OK GNU C++17 TESTS 46 154 0 1700
52436014 Nakagawa.Kanon A April 7, 2019, 3:31 a.m. OK GNU C++17 TESTS 46 154 0 1700
44356900 jimmy18 A Oct. 15, 2018, 12:50 p.m. OK GNU C++17 TESTS 46 154 307200 1700
49659585 srv_twry A Feb. 9, 2019, 11:44 a.m. OK GNU C++17 TESTS 46 154 307200 1700
8084486 7rx A Oct. 5, 2014, 11:15 a.m. OK Go TESTS 46 154 0 1700
8064581 arnoldjulians A Oct. 3, 2014, 3:30 a.m. OK Go TESTS 46 528 0 1700
8080916 Michael542 A Oct. 4, 2014, 9:29 p.m. OK Go TESTS 46 530 0 1700
21196289 pavel.rosputko A Oct. 4, 2016, 8:35 p.m. OK Haskell TESTS 46 280 20172800 1700
3069472 ILJ A Feb. 4, 2013, 5:02 a.m. OK Haskell TESTS 45 421 20992000 1700
3051571 mipt.vi002 A Feb. 1, 2013, 4:15 p.m. OK Haskell TESTS 45 1468 61030400 1700
3069533 DimsFromDergachy A Feb. 4, 2013, 5:30 a.m. OK Haskell TESTS 45 1484 56832000 1700
3046335 uwi A Feb. 1, 2013, 3:39 p.m. OK Java 6 TESTS 45 109 0 1700
3061064 emo A Feb. 2, 2013, 2:52 a.m. OK Java 6 TESTS 45 125 0 1700
3128598 karan173 A Feb. 14, 2013, 1:07 p.m. OK Java 6 TESTS 46 140 0 1700
3051789 coderbd A Feb. 1, 2013, 4:17 p.m. OK Java 6 TESTS 45 140 0 1700
3046445 Egor A Feb. 1, 2013, 3:39 p.m. OK Java 6 TESTS 45 140 0 1700
3055298 Aries512 A Feb. 1, 2013, 4:58 p.m. OK Java 6 TESTS 45 140 2252800 1700
3104170 winger A Feb. 11, 2013, 7:35 p.m. OK Java 6 TESTS 46 156 0 1700
3476640 bli0042 A April 5, 2013, 12:51 p.m. OK Java 6 TESTS 46 156 102400 1700
3068364 hs484 A Feb. 3, 2013, 6:48 p.m. OK Java 6 TESTS 45 171 0 1700
3048314 sayuan A Feb. 1, 2013, 3:51 p.m. OK Java 6 TESTS 45 171 2252800 1700
3065930 OgieKako A Feb. 3, 2013, 2:46 a.m. OK Java 7 TESTS 45 93 0 1700
3050148 jiangzhijie A Feb. 1, 2013, 4:03 p.m. OK Java 7 TESTS 45 93 0 1700
3050413 tanzaku A Feb. 1, 2013, 4:05 p.m. OK Java 7 TESTS 45 109 0 1700
3067370 trunghieu11 A Feb. 3, 2013, 2:30 p.m. OK Java 7 TESTS 45 156 0 1700
3048130 pashkal A Feb. 1, 2013, 3:49 p.m. OK Java 7 TESTS 45 171 0 1700
3061371 vkostyukov A Feb. 2, 2013, 4:24 a.m. OK Java 7 TESTS 45 171 102400 1700
3059028 S.Yesipenko A Feb. 1, 2013, 6:24 p.m. OK Java 7 TESTS 45 187 0 1700
3052225 Di735 A Feb. 1, 2013, 4:21 p.m. OK Java 7 TESTS 45 187 0 1700
3047199 Abra A Feb. 1, 2013, 3:44 p.m. OK Java 7 TESTS 45 187 0 1700
3046433 andrewzta A Feb. 1, 2013, 3:39 p.m. OK Java 7 TESTS 45 187 0 1700
30820074 theunderdoge97 A Sept. 29, 2017, 4:30 a.m. OK Java 8 TESTS 46 278 0 1700
55321857 amolpratap007 A June 9, 2019, 5:21 a.m. OK Java 8 TESTS 46 280 0 1700
61571185 onefineday01 A Sept. 30, 2019, 6:44 p.m. OK Java 8 TESTS 46 310 0 1700
10171503 Dongmin A March 6, 2015, 12:42 a.m. OK Java 8 TESTS 46 310 0 1700
9954829 poikniok A Feb. 22, 2015, 2:53 a.m. OK Java 8 TESTS 46 310 0 1700
14859362 Nirmit A Dec. 18, 2015, 10:47 a.m. OK Java 8 TESTS 46 312 0 1700
11596047 sweiss A June 15, 2015, 3:32 p.m. OK Java 8 TESTS 46 340 0 1700
40383298 KulikAlex A July 15, 2018, 3:56 p.m. OK Java 8 TESTS 46 372 0 1700
45181352 aman28rwt A Nov. 1, 2018, 5:19 p.m. OK Java 8 TESTS 46 374 0 1700
49809791 Shaykhutdinov-T-I A Feb. 11, 2019, 11:05 p.m. OK Java 8 TESTS 46 434 0 1700
69479951 vasiliybukhanov A Jan. 24, 2020, 5:24 p.m. OK Mono C# TESTS 46 216 3072000 1700
69464566 vasiliybukhanov A Jan. 24, 2020, 12:18 p.m. OK Mono C# TESTS 46 248 3072000 1700
3129085 mylifefordota A Feb. 14, 2013, 2:33 p.m. OK Mono C# TESTS 46 453 5222400 1700
3060402 supachai_pay A Feb. 1, 2013, 9:14 p.m. OK Mono C# TESTS 45 1968 3891200 1700
14302579 og.kostya A Nov. 16, 2015, 6:46 p.m. OK MS C# TESTS 46 124 102400 1700
4030572 marat.snowbear A July 6, 2013, 11:02 a.m. OK MS C# TESTS 46 171 1945600 1700
4220527 Dragonborn A Aug. 3, 2013, 12:01 p.m. OK MS C# TESTS 46 186 2969600 1700
3104309 alexander-nsk94 A Feb. 11, 2013, 8:01 p.m. OK MS C++ TESTS 46 46 0 1700
3131468 ze.shabani A Feb. 15, 2013, 8:23 a.m. OK MS C++ TESTS 46 46 0 1700
3050444 caustique A Feb. 1, 2013, 4:06 p.m. OK MS C++ TESTS 45 46 819200 1700
3849852 fastholf A June 9, 2013, 8:29 a.m. OK MS C++ TESTS 46 46 819200 1700
3056607 filo A Feb. 1, 2013, 5:14 p.m. OK MS C++ TESTS 45 62 0 1700
3053001 agul A Feb. 1, 2013, 4:28 p.m. OK MS C++ TESTS 45 62 0 1700
3085471 azim__ A Feb. 9, 2013, 6 a.m. OK MS C++ TESTS 46 62 0 1700
3173012 nanke_ A Feb. 22, 2013, 3:43 p.m. OK MS C++ TESTS 46 62 0 1700
3849857 fastholf A June 9, 2013, 8:32 a.m. OK MS C++ TESTS 46 62 0 1700
3059400 Timer A Feb. 1, 2013, 6:41 p.m. OK MS C++ TESTS 45 62 0 1700
12919078 SteelRaven A Sept. 10, 2015, 7:05 a.m. OK PyPy 3 TESTS 46 686 6246400 1700
3059594 Aries512 A Feb. 1, 2013, 7 p.m. OK Python 2 TESTS 45 500 0 1700
3077815 jgeralnik A Feb. 6, 2013, 2:13 p.m. OK Python 2 TESTS 46 514 0 1700
3060275 Aries512 A Feb. 1, 2013, 8:42 p.m. OK Python 2 TESTS 45 515 0 1700
3063941 m1_k3 A Feb. 2, 2013, 1:14 p.m. OK Python 2 TESTS 45 515 1638400 1700
3081031 hzhua A Feb. 7, 2013, 1:03 p.m. OK Python 2 TESTS 46 515 1638400 1700
3199211 daidailanlan A Feb. 26, 2013, 2:33 p.m. OK Python 2 TESTS 46 531 10854400 1700
3064253 KBRCH A Feb. 2, 2013, 2:14 p.m. OK Python 2 TESTS 45 546 3788800 1700
3061412 nealzane A Feb. 2, 2013, 4:32 a.m. OK Python 2 TESTS 45 562 1638400 1700
3069731 goooooooopan A Feb. 4, 2013, 7:01 a.m. OK Python 2 TESTS 45 578 2150400 1700
3048372 nwi A Feb. 1, 2013, 3:51 p.m. OK Python 2 TESTS 45 578 9420800 1700
5145447 yugle7 A Nov. 18, 2013, 8:19 p.m. OK Python 3 TESTS 46 872 9625600 1700
5145480 yugle7 A Nov. 18, 2013, 8:26 p.m. OK Python 3 TESTS 46 904 9113600 1700
19061064 RyanS A July 13, 2016, 2:54 a.m. OK Python 3 TESTS 46 966 0 1700
48768819 milosz A Jan. 22, 2019, 9:12 p.m. OK Python 3 TESTS 46 1402 716800 1700
20954280 orailly A Sept. 27, 2016, 6:46 p.m. OK Python 3 TESTS 46 1684 8704000 1700
41983687 Mk_Python_v1 A Aug. 23, 2018, 4:13 a.m. OK Python 3 TESTS 46 1778 0 1700
3135280 squallkt A Feb. 16, 2013, 5:20 a.m. OK Ruby TESTS 46 1031 8704000 1700
3828578 delta_4d A June 6, 2013, 4:14 p.m. OK Ruby TESTS 46 1109 0 1700
22999865 belovedeagle A Dec. 15, 2016, 7:35 a.m. OK Rust TESTS 46 124 2457600 1700
3047719 Duc A Feb. 1, 2013, 3:47 p.m. OK Scala TESTS 45 671 307200 1700
3080240 peking2 A Feb. 7, 2013, 10:03 a.m. OK Scala TESTS 46 733 409600 1700
3080288 peking2 A Feb. 7, 2013, 10:14 a.m. OK Scala TESTS 46 764 409600 1700

remove filters

Back to search problems