Codeforces Round 104 (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
145 Codeforces Round 104 (Div. 1) FINISHED False 7200 410741951 Jan. 22, 2012, 7 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2242 ) B Lucky Number 2 PROGRAMMING constructive algorithms 1800

B'Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Petya loves long lucky numbers very much. He is interested in the minimum lucky number d that meets some condition. Let cnt(x) be the number of occurrences of number x in number d as a substring. For example, if d xe2 x80 x89= xe2 x80 x89747747, then cnt(4) xe2 x80 x89= xe2 x80 x892, cnt(7) xe2 x80 x89= xe2 x80 x894, cnt(47) xe2 x80 x89= xe2 x80 x892, cnt(74) xe2 x80 x89= xe2 x80 x892. Petya wants the following condition to fulfil simultaneously: cnt(4) xe2 x80 x89= xe2 x80 x89a1, cnt(7) xe2 x80 x89= xe2 x80 x89a2, cnt(47) xe2 x80 x89= xe2 x80 x89a3, cnt(74) xe2 x80 x89= xe2 x80 x89a4. Petya is not interested in the occurrences of other numbers. Help him cope with this task. The single line contains four integers a1, a2, a3 and a4 (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89a1, xe2 x80 x89a2, xe2 x80 x89a3, xe2 x80 x89a4 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106). On the single line print without leading zeroes the answer to the problem -- the minimum lucky number d such, that cnt(4) xe2 x80 x89= xe2 x80 x89a1, cnt(7) xe2 x80 x89= xe2 x80 x89a2, cnt(47) xe2 x80 x89= xe2 x80 x89a3, cnt(74) xe2 x80 x89= xe2 x80 x89a4. If such number does not exist, print the single number "-1" (without the quotes).'...

Tutorials

Codeforces Round #104 - Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
1120972 your_conscience B Jan. 27, 2012, 3:30 p.m. OK Delphi TESTS 99 80 819200 1800
1159017 Jovfer B Feb. 9, 2012, 7:48 a.m. OK Delphi TESTS 99 80 921600 1800
1833520 Sert B June 26, 2012, 5:52 p.m. OK Delphi TESTS 99 80 9523200 1800
1113279 kiber B Jan. 23, 2012, 7:26 p.m. OK Delphi TESTS 99 90 921600 1800
1111337 Quercitron B Jan. 22, 2012, 8:41 p.m. OK Delphi TESTS 99 140 921600 1800
1111799 ruban B Jan. 23, 2012, 5:30 a.m. OK Delphi TESTS 99 160 921600 1800
1156623 Depool B Feb. 7, 2012, 9:12 p.m. OK Delphi TESTS 99 160 2867200 1800
1105102 agul B Jan. 22, 2012, 7:53 a.m. OK Delphi TESTS 99 160 16998400 1800
1355315 alexander-nsk94 B March 13, 2012, 3:39 p.m. OK Delphi TESTS 99 160 16998400 1800
1104573 tourist B Jan. 22, 2012, 7:43 a.m. OK Delphi TESTS 99 190 16896000 1800
1186187 jetic B Feb. 17, 2012, 2:40 a.m. OK FPC TESTS 99 80 1024000 1800
1109329 gs_03 B Jan. 22, 2012, 11:05 a.m. OK FPC TESTS 99 90 6041600 1800
1109196 gskhirtladze B Jan. 22, 2012, 10:47 a.m. OK FPC TESTS 99 90 6041600 1800
1111695 zdf615328619 B Jan. 23, 2012, 3:25 a.m. OK FPC TESTS 99 90 6246400 1800
2016236 25122008 B Aug. 15, 2012, 10:13 a.m. OK FPC TESTS 99 110 5324800 1800
1421811 con_nha_ngheo B March 27, 2012, 7:04 a.m. OK FPC TESTS 99 110 5529600 1800
1110079 Nik_Storm_2010 B Jan. 22, 2012, 1:25 p.m. OK FPC TESTS 99 110 6041600 1800
1108508 AliD B Jan. 22, 2012, 9:49 a.m. OK FPC TESTS 99 110 6553600 1800
1109966 zanoes B Jan. 22, 2012, 1:06 p.m. OK FPC TESTS 99 130 1024000 1800
1256205 superpear B March 2, 2012, 7:03 a.m. OK FPC TESTS 99 130 5120000 1800
1105127 kawatea B Jan. 22, 2012, 7:53 a.m. OK GNU C TESTS 99 50 1331200 1800
3074110 cpy B Feb. 5, 2013, 10:38 a.m. OK GNU C TESTS 99 218 2048000 1800
11345701 harunsami B May 29, 2015, 12:47 p.m. OK GNU C TESTS 99 248 0 1800
11345555 harunsami B May 29, 2015, 12:36 p.m. OK GNU C TESTS 99 248 0 1800
11343157 hasann B May 29, 2015, 9:02 a.m. OK GNU C TESTS 99 248 0 1800
1120866 mage B Jan. 27, 2012, 2:47 p.m. OK GNU C TESTS 99 280 1331200 1800
1171370 vjudge4 B Feb. 11, 2012, 8:03 a.m. OK GNU C++ TESTS 99 30 3379200 1800
1111582 huicpc36 B Jan. 23, 2012, 12:24 a.m. OK GNU C++ TESTS 99 30 3379200 1800
1112195 FattyPenguin B Jan. 23, 2012, 9:52 a.m. OK GNU C++ TESTS 99 30 4403200 1800
27892436 HeathcliffAC B June 18, 2017, 11:28 p.m. OK GNU C++ TESTS 99 30 5017600 1800
1385318 roypalacios B March 21, 2012, 5:30 p.m. OK GNU C++ TESTS 99 30 9011200 1800
2389152 vjudge5 B Oct. 20, 2012, 4:20 a.m. OK GNU C++ TESTS 99 31 7987200 1800
3724234 frog1902 B May 15, 2013, 4:05 p.m. OK GNU C++ TESTS 99 46 0 1800
3724232 vjudge2 B May 15, 2013, 4:04 p.m. OK GNU C++ TESTS 99 46 0 1800
2755684 Avalanche B Dec. 12, 2012, 6:05 p.m. OK GNU C++ TESTS 99 46 11878400 1800
1113546 xpycc B Jan. 24, 2012, 2:22 a.m. OK GNU C++ TESTS 99 50 1331200 1800
1108414 Cromel B Jan. 22, 2012, 9:46 a.m. OK GNU C++0x TESTS 99 60 4608000 1800
1111702 wisterik B Jan. 23, 2012, 3:33 a.m. OK GNU C++0x TESTS 99 60 6656000 1800
1106039 scientist1642 B Jan. 22, 2012, 8:12 a.m. OK GNU C++0x TESTS 99 60 7884800 1800
1105099 lyoz B Jan. 22, 2012, 7:53 a.m. OK GNU C++0x TESTS 99 60 8396800 1800
7621440 ztk B Aug. 29, 2014, 1:01 p.m. OK GNU C++0x TESTS 99 62 4096000 1800
6564143 marat.snowbear B May 6, 2014, 6:45 p.m. OK GNU C++0x TESTS 99 62 6041600 1800
6149790 RedOne B March 26, 2014, 4:39 p.m. OK GNU C++0x TESTS 99 62 9932800 1800
9586368 sherlock_holms B Jan. 27, 2015, 5:47 p.m. OK GNU C++0x TESTS 99 92 5836800 1800
6791960 behzad.nouri B June 3, 2014, 7:57 p.m. OK GNU C++0x TESTS 99 92 6246400 1800
9939242 AlexJH B Feb. 20, 2015, 3:48 p.m. OK GNU C++0x TESTS 99 92 7168000 1800
58961869 rainboy B Aug. 17, 2019, 3:40 p.m. OK GNU C11 TESTS 99 248 2048000 1800
19378915 supasaya B July 24, 2016, 7:31 a.m. OK GNU C++11 TESTS 99 60 2969600 1800
29375280 pkien B Aug. 12, 2017, 10:52 a.m. OK GNU C++11 TESTS 99 60 9011200 1800
13936176 last_one B Oct. 29, 2015, 3:34 p.m. OK GNU C++11 TESTS 99 60 40038400 1800
22036610 ajs97 B Nov. 4, 2016, 2:41 p.m. OK GNU C++11 TESTS 99 62 2355200 1800
14257017 Kanish_The_Vista B Nov. 14, 2015, 3:16 p.m. OK GNU C++11 TESTS 99 62 2969600 1800
10665614 delta_4d B April 12, 2015, 10:31 a.m. OK GNU C++11 TESTS 99 62 4710400 1800
12601825 rex321 B Aug. 19, 2015, 11:04 a.m. OK GNU C++11 TESTS 99 62 5529600 1800
15495611 lone_rider B Jan. 22, 2016, 9:21 a.m. OK GNU C++11 TESTS 99 62 7987200 1800
17838747 rituranjna B May 11, 2016, 4:26 a.m. OK GNU C++11 TESTS 99 62 8089600 1800
20745134 NewAcount B Sept. 18, 2016, 11:10 p.m. OK GNU C++11 TESTS 99 62 8908800 1800
27838754 shyamkb B June 17, 2017, 6:03 a.m. OK GNU C++14 TESTS 99 62 2048000 1800
39671476 xsc B June 26, 2018, 9:34 a.m. OK GNU C++14 TESTS 99 62 4198400 1800
61927035 VROOM_VARUN B Oct. 5, 2019, 2:58 p.m. OK GNU C++14 TESTS 99 62 5017600 1800
39678652 piyushsethia1999 B June 26, 2018, 2:46 p.m. OK GNU C++14 TESTS 99 62 5939200 1800
64110966 stefdasca B Nov. 2, 2019, 6:39 p.m. OK GNU C++14 TESTS 99 62 5939200 1800
29788550 Ahmad_Osama B Aug. 25, 2017, 5:36 p.m. OK GNU C++14 TESTS 99 62 7168000 1800
39873953 hell_hacker B July 2, 2018, 4:34 p.m. OK GNU C++14 TESTS 99 62 8294400 1800
42458346 nimom B Sept. 4, 2018, 12:34 p.m. OK GNU C++14 TESTS 99 62 8294400 1800
20629421 m7mdbadawy B Sept. 15, 2016, 12:45 a.m. OK GNU C++14 TESTS 99 62 8396800 1800
33074242 yaksha B Dec. 10, 2017, 7:01 a.m. OK GNU C++14 TESTS 99 62 8601600 1800
51315818 yuhta B March 14, 2019, 11:58 p.m. OK GNU C++17 TESTS 99 62 2048000 1800
59541646 vertebruh B Aug. 26, 2019, 7:12 p.m. OK GNU C++17 TESTS 99 92 2048000 1800
40774827 AlimovDavron B July 26, 2018, 10:42 a.m. OK GNU C++17 TESTS 99 92 2048000 1800
54401873 thenymphsofdelphi B May 20, 2019, 1:30 a.m. OK GNU C++17 TESTS 99 92 5939200 1800
66600879 davidisimo040 B Dec. 10, 2019, 4:28 p.m. OK GNU C++17 TESTS 99 92 5939200 1800
65226633 fezjo B Nov. 17, 2019, 2:14 a.m. OK GNU C++17 TESTS 99 92 5939200 1800
59689129 Ari B Aug. 30, 2019, 4:38 a.m. OK GNU C++17 TESTS 99 92 5939200 1800
54687873 adityaaaaaaaaaaaaaaa B May 26, 2019, 5 p.m. OK GNU C++17 TESTS 99 92 5939200 1800
54401875 vjudge3 B May 20, 2019, 1:31 a.m. OK GNU C++17 TESTS 99 92 5939200 1800
50770055 2ooWeak2ooSlow2ooDumb B March 4, 2019, 3:41 a.m. OK GNU C++17 TESTS 99 92 5939200 1800
1110274 cojna B Jan. 22, 2012, 2:17 p.m. OK Haskell TESTS 99 250 3174400 1800
56028601 sorry_im_smurfing B June 25, 2019, 8:19 a.m. OK Haskell TESTS 99 528 85196800 1800
1112685 Rotsor B Jan. 23, 2012, 2:39 p.m. OK Haskell TESTS 99 780 105062400 1800
15914856 not_bot_but_POT B Feb. 9, 2016, 1:54 p.m. OK Haskell TESTS 99 810 97894400 1800
1112659 Rotsor B Jan. 23, 2012, 2:29 p.m. OK Haskell TESTS 99 830 105062400 1800
35840007 ______u______ B March 2, 2018, 2:09 p.m. OK Haskell TESTS 99 840 142745600 1800
35840001 ______n______ B March 2, 2018, 2:09 p.m. OK Haskell TESTS 99 840 142745600 1800
35839310 _____k_____ B March 2, 2018, 1:50 p.m. OK Haskell TESTS 99 840 142745600 1800
35839306 _____i_____ B March 2, 2018, 1:50 p.m. OK Haskell TESTS 99 840 142745600 1800
35834756 ______h______ B March 2, 2018, 12:10 p.m. OK Haskell TESTS 99 840 142745600 1800
1107410 anhdt B Jan. 22, 2012, 8:45 a.m. OK Java 6 TESTS 99 110 43417600 1800
1156777 OgieKako B Feb. 7, 2012, 11:52 p.m. OK Java 6 TESTS 99 140 43315200 1800
1103875 alexey.enkov B Jan. 22, 2012, 7:32 a.m. OK Java 6 TESTS 99 140 43520000 1800
1106980 Hadi_Asiaie B Jan. 22, 2012, 8:35 a.m. OK Java 6 TESTS 99 160 43417600 1800
1118151 YuukaKazami B Jan. 26, 2012, 6:28 a.m. OK Java 6 TESTS 99 170 43315200 1800
1111525 Dunaril B Jan. 22, 2012, 11:17 p.m. OK Java 6 TESTS 99 170 43417600 1800
1108426 Omar.Darwish B Jan. 22, 2012, 9:46 a.m. OK Java 6 TESTS 99 170 43417600 1800
1110658 sayuan B Jan. 22, 2012, 3:42 p.m. OK Java 6 TESTS 99 190 43417600 1800
1103291 tsukuno B Jan. 22, 2012, 7:24 a.m. OK Java 6 TESTS 99 190 43417600 1800
1109554 Betlista B Jan. 22, 2012, 11:42 a.m. OK Java 6 TESTS 99 200 47411200 1800
7009614 owenomar B July 4, 2014, 9:24 a.m. OK Java 7 TESTS 99 248 4505600 1800
5870066 jakabfia B Feb. 2, 2014, 7:24 p.m. OK Java 7 TESTS 99 278 4505600 1800
15432665 mkirsche B Jan. 18, 2016, 8:44 p.m. OK Java 7 TESTS 99 528 0 1800
15158813 p1p13 B Jan. 2, 2016, 1:24 p.m. OK Java 7 TESTS 99 530 24166400 1800
15036503 xiaowuc1 B Dec. 26, 2015, 7:16 p.m. OK Java 7 TESTS 99 530 45670400 1800
58961852 Dukkha B Aug. 17, 2019, 3:39 p.m. OK Java 8 TESTS 99 280 0 1800
30661233 mishagam B Sept. 24, 2017, 9:21 a.m. OK Java 8 TESTS 99 310 11776000 1800
56602578 Xylenox B July 6, 2019, 1:59 a.m. OK Java 8 TESTS 99 372 0 1800
12705822 fiter B Aug. 26, 2015, 9:36 a.m. OK Java 8 TESTS 99 372 3072000 1800
38721081 amnesiac_dusk B May 29, 2018, 2:19 p.m. OK Java 8 TESTS 99 372 15974400 1800
50540284 AJ47 B Feb. 26, 2019, 5:44 p.m. OK Java 8 TESTS 99 404 2764800 1800
42870321 spar5h B Sept. 14, 2018, 6:26 p.m. OK Java 8 TESTS 99 434 4198400 1800
60430064 StayAwayFromBitches B Sept. 12, 2019, 9:07 a.m. OK Java 8 TESTS 99 436 0 1800
26475549 Petruchcho B April 18, 2017, 12:30 p.m. OK Java 8 TESTS 99 498 20684800 1800
46829189 KulikAlex B Dec. 9, 2018, 8:39 p.m. OK Java 8 TESTS 99 498 42188800 1800
1106988 it4.kp B Jan. 22, 2012, 8:35 a.m. OK Mono C# TESTS 99 190 31641600 1800
1121383 extremall B Jan. 27, 2012, 8:01 p.m. OK Mono C# TESTS 99 1250 11878400 1800
1354029 UESTC_Defense B March 13, 2012, 7:24 a.m. OK Mono C# TESTS 99 1500 11878400 1800
4128418 pnomarev B July 21, 2013, 10:18 a.m. OK MS C# TESTS 99 78 12083200 1800
4128405 pnomarev B July 21, 2013, 10:17 a.m. OK MS C# TESTS 99 1437 307200 1800
5288632 serglag B Nov. 28, 2013, 5:17 p.m. OK MS C++ TESTS 99 30 2048000 1800
1105975 constkir B Jan. 22, 2012, 8:11 a.m. OK MS C++ TESTS 99 30 11366400 1800
3639788 XilinX B April 27, 2013, 8:21 a.m. OK MS C++ TESTS 99 31 4505600 1800
1108288 Milanin B Jan. 22, 2012, 9:38 a.m. OK MS C++ TESTS 99 50 3379200 1800
1104843 AnnKats93 B Jan. 22, 2012, 7:48 a.m. OK MS C++ TESTS 99 60 3379200 1800
1109030 YX201314 B Jan. 22, 2012, 10:27 a.m. OK MS C++ TESTS 99 60 3379200 1800
1109106 al13n B Jan. 22, 2012, 10:37 a.m. OK MS C++ TESTS 99 60 3481600 1800
1360561 ItsNear B March 16, 2012, 8:05 a.m. OK MS C++ TESTS 99 60 4403200 1800
1106126 kcm1700 B Jan. 22, 2012, 8:14 a.m. OK MS C++ TESTS 99 60 5632000 1800
1109359 e-maxx B Jan. 22, 2012, 11:10 a.m. OK MS C++ TESTS 99 60 10444800 1800
58512610 CtrlAlt B Aug. 9, 2019, 8:01 p.m. OK MS C++ 2017 TESTS 99 372 0 1800
1117760 Darooha B Jan. 25, 2012, 9:24 p.m. OK Ocaml TESTS 99 60 13516800 1800
1152080 watashi B Feb. 6, 2012, 1:06 a.m. OK Perl TESTS 99 230 9216000 1800
53906244 donjar B May 9, 2019, 12:54 p.m. OK PyPy 3 TESTS 99 560 24985600 1800
1115563 itomoyasu B Jan. 24, 2012, 7:56 p.m. OK Python 2 TESTS 99 60 6860800 1800
1172907 pauek B Feb. 11, 2012, 5:37 p.m. OK Python 2 TESTS 99 60 6860800 1800
1117807 xonatius B Jan. 25, 2012, 10:46 p.m. OK Python 2 TESTS 99 60 6860800 1800
1113596 BlackEagle B Jan. 24, 2012, 3:29 a.m. OK Python 2 TESTS 99 60 6860800 1800
1132265 cebrusfspy B Feb. 2, 2012, 7:46 a.m. OK Python 2 TESTS 99 80 6860800 1800
1114818 ronaflx B Jan. 24, 2012, 2:28 p.m. OK Python 2 TESTS 99 80 6860800 1800
1109678 zibada B Jan. 22, 2012, 12:08 p.m. OK Python 2 TESTS 99 80 6860800 1800
1109082 pank.dm B Jan. 22, 2012, 10:34 a.m. OK Python 2 TESTS 99 80 6860800 1800
1108234 alexej B Jan. 22, 2012, 9:36 a.m. OK Python 2 TESTS 99 80 6860800 1800
1156779 igh B Feb. 7, 2012, 11:54 p.m. OK Python 2 TESTS 99 80 7065600 1800
34619196 loyolman B Jan. 27, 2018, 10:52 p.m. OK Python 3 TESTS 99 124 11571200 1800
32103698 yugle7 B Nov. 6, 2017, 6:55 p.m. OK Python 3 TESTS 99 154 5939200 1800
5446905 TsunamiNoLetGo B Dec. 15, 2013, 7:08 p.m. OK Python 3 TESTS 99 156 6041600 1800
42123315 Mk_Python_v1 B Aug. 26, 2018, 1:38 p.m. OK Python 3 TESTS 99 248 5939200 1800
54402594 ntrung03 B May 20, 2019, 2:38 a.m. OK Python 3 TESTS 99 248 6553600 1800
44459612 Marinkovic B Oct. 17, 2018, 7:42 p.m. OK Python 3 TESTS 99 278 4096000 1800
54402598 vjudge1 B May 20, 2019, 2:38 a.m. OK Python 3 TESTS 99 278 6553600 1800
1116553 K_operafan B Jan. 25, 2012, 10:31 a.m. OK Ruby TESTS 99 160 9625600 1800

remove filters

Back to search problems