Codeforces Beta Round 77 (Div. 1 Only)

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
95 Codeforces Beta Round 77 (Div. 1 Only) FINISHED False 7200 466268423 July 8, 2011, 3 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 1856 ) E Lucky Country PROGRAMMING dp dsu graphs 2400

Petya loves lucky numbers. Everybody knows that positive integers are lucky if their decimal representation doesn 't contain digits other than 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. One night Petya was sleeping. He was dreaming of being the president of some island country. The country is represented by islands connected by two-way roads. Between some islands there is no road way, even through other islands, that 's why the country is divided into several regions. More formally, each island belongs to exactly one region, there is a path between any two islands located in the same region; there is no path between any two islands from different regions. A region is lucky if the amount of islands in it is a lucky number. As a real president, Petya first decided to build a presidential palace. Being a lucky numbers ' fan, Petya wants to position his palace in one of the lucky regions. However, it is possible that initially the country has no such regions. In this case Petya can build additional roads between different regions, thus joining them. Find the minimum number of roads needed to build to create a lucky region. The first line contains two integers n and m (1 ≤ n, m ≤ 105). They are the number of islands and the number of roads correspondingly. Next m lines contain road descriptions. Each road is defined by the numbers of islands that it connects: that is, by two integers u and v (1 ≤ u, v ≤ n). Some roads can connect an island with itself; there can be more than one road between a pair of islands. Numbers in each line are separated by exactly one space character. If there 's no solution, output the only number "-1" (without the quotes). Otherwise, output the minimum number of roads r that need to be built to get a lucky region.

Tutorials

Codeforces Beta Round #77 - Analysis

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
931577 winterwolf94 E Dec. 5, 2011, 4:03 p.m. OK Delphi TESTS 137 160 3788800 2400
538145 sankear E July 8, 2011, 9:16 p.m. OK Delphi TESTS 137 250 7782400 2400
543483 vlad107 E July 12, 2011, 4:59 p.m. OK Delphi TESTS 137 690 19865600 2400
929595 LifeKeeper E Dec. 4, 2011, 2:17 p.m. OK FPC TESTS 137 270 19660800 2400
783589 superY E Oct. 19, 2011, 4:31 a.m. OK FPC TESTS 137 340 6963200 2400
1358436 Rubanenko E March 15, 2012, 8:05 a.m. OK FPC TESTS 137 340 7577600 2400
929710 nlbao E Dec. 4, 2011, 3:20 p.m. OK FPC TESTS 137 360 2662400 2400
1360443 Furko E March 16, 2012, 7:11 a.m. OK FPC TESTS 137 410 17510400 2400
537686 Sereja E July 8, 2011, 6:43 p.m. OK FPC TESTS 137 500 10854400 2400
1386446 sillycross E March 22, 2012, 9:01 a.m. OK FPC TESTS 137 630 5836800 2400
538549 xujie E July 9, 2011, 3:02 a.m. OK FPC TESTS 137 670 6348800 2400
543619 vlad107 E July 12, 2011, 7:09 p.m. OK FPC TESTS 137 690 12288000 2400
929672 nlbao E Dec. 4, 2011, 2:49 p.m. OK FPC TESTS 137 810 2662400 2400
539232 scottai1 E July 9, 2011, 10:33 a.m. OK GNU C TESTS 137 140 3072000 2400
1969594 vjudge1 E Aug. 2, 2012, 1:57 a.m. OK GNU C TESTS 137 140 9420800 2400
535864 -.- E July 8, 2011, 4:35 p.m. OK GNU C TESTS 137 190 3379200 2400
40563174 AnnieCai E July 20, 2018, 2:43 a.m. OK GNU C++ TESTS 137 46 1228800 2400
40563302 AnnieCai E July 20, 2018, 2:51 a.m. OK GNU C++ TESTS 137 61 1228800 2400
40547876 AnnieCai E July 19, 2018, 12:45 p.m. OK GNU C++ TESTS 137 61 2662400 2400
40563573 AnnieCai E July 20, 2018, 3:08 a.m. OK GNU C++ TESTS 137 62 1228800 2400
40532613 Hacheylight E July 19, 2018, 4 a.m. OK GNU C++ TESTS 137 62 1228800 2400
40532413 Hacheylight E July 19, 2018, 3:53 a.m. OK GNU C++ TESTS 137 62 1228800 2400
4913919 yangff E Oct. 27, 2013, 3:16 p.m. OK GNU C++ TESTS 137 62 1536000 2400
15587346 vjudge2 E Jan. 26, 2016, 6:24 a.m. OK GNU C++ TESTS 137 62 6451200 2400
40533216 vjudge1 E July 19, 2018, 4:27 a.m. OK GNU C++ TESTS 137 77 1228800 2400
18517537 Kerim.K E June 16, 2016, 10:02 a.m. OK GNU C++ TESTS 137 78 1433600 2400
553183 cavalier E July 21, 2011, 12:34 p.m. OK GNU C++0x TESTS 137 90 3891200 2400
548997 littlekfc E July 17, 2011, 1:50 a.m. OK GNU C++0x TESTS 137 90 3891200 2400
535690 watashi E July 8, 2011, 4:30 p.m. OK GNU C++0x TESTS 137 90 3891200 2400
6664354 k0st1a E May 20, 2014, 10:04 p.m. OK GNU C++0x TESTS 137 124 1331200 2400
10226120 SeyedParsa E March 10, 2015, 12:07 p.m. OK GNU C++0x TESTS 137 124 109568000 2400
10209311 PAP E March 8, 2015, 3:29 p.m. OK GNU C++0x TESTS 137 124 227532800 2400
3615839 binwin20 E April 24, 2013, 10:03 a.m. OK GNU C++0x TESTS 137 125 4812800 2400
861872 siuvit E Nov. 13, 2011, 2:01 p.m. OK GNU C++0x TESTS 137 130 2764800 2400
538912 imslavko E July 9, 2011, 7:14 a.m. OK GNU C++0x TESTS 137 140 4608000 2400
9396898 aliasadiiii E Jan. 10, 2015, 11:13 a.m. OK GNU C++0x TESTS 137 154 2662400 2400
61874890 rainboy E Oct. 4, 2019, 7:43 p.m. OK GNU C11 TESTS 137 373 2457600 2400
61680271 yuzhechuan E Oct. 2, 2019, 12:19 a.m. OK GNU C++11 TESTS 137 46 4812800 2400
30125122 ntu_vjudge_2 E Sept. 6, 2017, 7:23 a.m. OK GNU C++11 TESTS 137 61 1228800 2400
29965658 eddy1021 E Sept. 1, 2017, 6:50 a.m. OK GNU C++11 TESTS 137 61 1228800 2400
61858782 Dream-chasing_Juvenile E Oct. 4, 2019, 2:45 p.m. OK GNU C++11 TESTS 137 61 1228800 2400
40992554 ReaLNero1 E July 31, 2018, 1:24 a.m. OK GNU C++11 TESTS 137 62 1228800 2400
61587292 DFS_lover E Oct. 1, 2019, 5:36 a.m. OK GNU C++11 TESTS 137 62 1638400 2400
40533702 HeHere E July 19, 2018, 4:52 a.m. OK GNU C++11 TESTS 137 62 4915200 2400
64686163 wangzhijian E Nov. 11, 2019, 11:48 a.m. OK GNU C++11 TESTS 137 62 5632000 2400
40550957 little_waxberry E July 19, 2018, 2:25 p.m. OK GNU C++11 TESTS 137 62 6963200 2400
13341990 Matrix.code E Oct. 2, 2015, 10:45 a.m. OK GNU C++11 TESTS 137 62 8499200 2400
43107229 Yoshiyuki E Sept. 20, 2018, 9:25 a.m. OK GNU C++14 TESTS 137 62 101683200 2400
61554411 vjudge3 E Sept. 30, 2019, 1:34 p.m. OK GNU C++14 TESTS 137 78 3174400 2400
37490551 bluefi E April 20, 2018, 2:37 p.m. OK GNU C++14 TESTS 137 78 5324800 2400
58839744 Heshamovic E Aug. 15, 2019, 1:08 a.m. OK GNU C++14 TESTS 137 78 7168000 2400
43107516 Yoshiyuki E Sept. 20, 2018, 9:36 a.m. OK GNU C++14 TESTS 137 78 101683200 2400
26952008 IMyself E May 8, 2017, 7:15 a.m. OK GNU C++14 TESTS 137 93 1536000 2400
56765110 upobir E July 9, 2019, 5:52 p.m. OK GNU C++14 TESTS 137 93 1945600 2400
39788185 carlosvfs E June 30, 2018, 5:02 a.m. OK GNU C++14 TESTS 137 93 2457600 2400
33576657 Jubair_2147483647 E Dec. 23, 2017, 7:16 p.m. OK GNU C++14 TESTS 137 93 3276800 2400
31494236 islamtaha E Oct. 18, 2017, 10:26 p.m. OK GNU C++14 TESTS 137 93 4096000 2400
42098520 YazanRi E Aug. 25, 2018, 6:03 p.m. OK GNU C++17 TESTS 137 77 10137600 2400
56297638 hongzhiyin E June 30, 2019, 7 a.m. OK GNU C++17 TESTS 137 78 1638400 2400
46573970 Nni E Dec. 4, 2018, 7:37 a.m. OK GNU C++17 TESTS 137 78 2355200 2400
42103951 Abdelrhman_Akram E Aug. 25, 2018, 9:44 p.m. OK GNU C++17 TESTS 137 78 7680000 2400
42128383 islammohsen E Aug. 26, 2018, 4:44 p.m. OK GNU C++17 TESTS 137 78 7884800 2400
40519500 carott E July 18, 2018, 3:13 p.m. OK GNU C++17 TESTS 137 93 1331200 2400
59868807 all_too_well E Sept. 1, 2019, 6:21 p.m. OK GNU C++17 TESTS 137 93 1638400 2400
46573739 Nni E Dec. 4, 2018, 7:29 a.m. OK GNU C++17 TESTS 137 93 2355200 2400
46572084 Nni E Dec. 4, 2018, 6:33 a.m. OK GNU C++17 TESTS 137 93 2764800 2400
46572878 Nni E Dec. 4, 2018, 6:58 a.m. OK GNU C++17 TESTS 137 93 2764800 2400
541272 yaro E July 10, 2011, 7:54 p.m. OK Java 6 TESTS 137 160 43315200 2400
541267 yaro E July 10, 2011, 7:49 p.m. OK Java 6 TESTS 137 310 43315200 2400
541226 yaro E July 10, 2011, 7:18 p.m. OK Java 6 TESTS 137 360 55193600 2400
541214 yaro E July 10, 2011, 7:03 p.m. OK Java 6 TESTS 137 380 58265600 2400
541221 yaro E July 10, 2011, 7:12 p.m. OK Java 6 TESTS 137 390 57446400 2400
538141 uwi E July 8, 2011, 9:13 p.m. OK Java 6 TESTS 137 470 43110400 2400
538127 uwi E July 8, 2011, 9:04 p.m. OK Java 6 TESTS 137 480 43110400 2400
538103 uwi E July 8, 2011, 8:55 p.m. OK Java 6 TESTS 137 480 43110400 2400
623836 OgieKako E Aug. 20, 2011, 3:56 p.m. OK Java 6 TESTS 137 640 35123200 2400
562822 uwi E July 23, 2011, 2:49 p.m. OK Java 6 TESTS 137 640 43008000 2400
6605311 qwerty787788 E May 12, 2014, 4:42 p.m. OK Java 7 TESTS 137 810 3788800 2400
29528913 Ahmed.Shawky E Aug. 17, 2017, 3:08 p.m. OK Java 8 TESTS 137 343 17612800 2400
20682804 Ahmad_Elsagheer E Sept. 17, 2016, 1:19 p.m. OK Java 8 TESTS 137 467 0 2400
44076816 Omar_Emad E Oct. 10, 2018, 1:20 p.m. OK Java 8 TESTS 137 577 25088000 2400
30283372 Nesrin E Sept. 12, 2017, 10:11 a.m. OK Java 8 TESTS 137 732 0 2400
61874889 Dukkha E Oct. 4, 2019, 7:43 p.m. OK Java 8 TESTS 137 826 0 2400
40535542 vjudge1 E July 19, 2018, 6:03 a.m. OK MS C++ TESTS 137 124 6553600 2400
563254 hdu_yu E July 24, 2011, 2:17 a.m. OK MS C++ TESTS 137 130 3891200 2400
614720 maksay E Aug. 18, 2011, 9:17 p.m. OK MS C++ TESTS 137 130 4198400 2400
543386 xowind E July 12, 2011, 3:25 p.m. OK MS C++ TESTS 137 140 2969600 2400
539465 good_mood E July 9, 2011, 1 p.m. OK MS C++ TESTS 137 140 7884800 2400
545273 Fdg E July 14, 2011, 2:26 p.m. OK MS C++ TESTS 137 140 11776000 2400
598166 acrux E Aug. 8, 2011, 8:56 a.m. OK MS C++ TESTS 137 170 6246400 2400
30289204 Tampere E Sept. 12, 2017, 2:51 p.m. OK MS C++ TESTS 137 187 1740800 2400
685107 zjut_DD E Sept. 9, 2011, 6:11 a.m. OK MS C++ TESTS 137 190 6860800 2400
538201 hydrastuff E July 8, 2011, 9:50 p.m. OK MS C++ TESTS 137 220 4198400 2400

remove filters

Back to search problems