Codeforces Round 254 (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
444 Codeforces Round 254 (Div. 1) FINISHED False 7200 327171299 July 6, 2014, 1:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3426 ) A DZY Loves Physics PROGRAMMING greedy math 1800

B"DZY loves Physics, and he enjoys calculating density. Almost everything has density, even a graph. We define the density of a non-directed graph (nodes and edges of the graph have some values) as follows: Once DZY got a graph G, now he wants to find a connected induced subgraph G' of the graph, such that the density of G' is as large as possible. An induced subgraph G'(V', xe2 x80 x89E') of a graph G(V, xe2 x80 x89E) is a graph that satisfies: Help DZY to find the induced subgraph with maximum density. Note that the induced subgraph you choose must be connected. The first line contains two space-separated integers n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89500), . Integer n represents the number of nodes of the graph G, m represents the number of edges. The second line contains n space-separated integers xi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106), where xi represents the value of the i-th node. Consider the graph nodes are numbered from 1 to n. Each of the next m lines contains three space-separated integers ai, xe2 x80 x89bi, xe2 x80 x89ci (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89< xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n; 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ci xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89103), denoting an edge between node ai and bi with value ci. The graph won't contain multiple edges. Output a real number denoting the answer, with an absolute or relative error of at most 10 xe2 x80 x89- xe2 x80 x899. In the first sample, you can only choose an empty subgraph, or the subgraph containing only node 1. In the second sample, choosing the whole graph is optimal."...

Tutorials

Codeforces Round #254 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
7425338 hos.lyric A Aug. 11, 2014, 8:52 a.m. OK D TESTS 38 109 4915200 1800
7071999 izuru A July 13, 2014, 4:34 a.m. OK D TESTS 38 124 102400 1800
7041479 ruban A July 7, 2014, 2:24 p.m. OK Delphi TESTS 38 46 32051200 1800
7021875 Alex_2oo8 A July 6, 2014, 1:10 p.m. OK FPC TESTS 38 31 0 1800
7027512 vilcheuski A July 6, 2014, 1:59 p.m. OK FPC TESTS 38 31 8908800 1800
7297552 imhereonlyforcookies A July 31, 2014, 7:30 a.m. OK FPC TESTS 38 31 20172800 1800
7149079 alc A July 18, 2014, 12:55 p.m. OK FPC TESTS 38 46 0 1800
7100642 DaibaNana A July 14, 2014, 12:37 p.m. OK FPC TESTS 38 46 0 1800
7036513 chicken_coder A July 7, 2014, 1:42 a.m. OK FPC TESTS 38 46 0 1800
7441959 BenderRodriguez A Aug. 13, 2014, 11:43 a.m. OK FPC TESTS 38 46 0 1800
47086592 luogu_bot4 A Dec. 16, 2018, 3:28 a.m. OK FPC TESTS 38 46 0 1800
7442100 BenderRodriguez A Aug. 13, 2014, noon OK FPC TESTS 38 46 0 1800
7274489 Myguicl A July 28, 2014, 6:04 a.m. OK FPC TESTS 38 46 0 1800
7024707 luoruixuan A July 6, 2014, 1:32 p.m. OK GNU C TESTS 38 46 0 1800
15429462 hardiknegi A Jan. 18, 2016, 3:46 p.m. OK GNU C TESTS 38 77 0 1800
7056759 vis10326 A July 10, 2014, 6:04 a.m. OK GNU C TESTS 38 78 0 1800
7250109 automan A July 26, 2014, 12:45 p.m. OK GNU C TESTS 38 78 2048000 1800
7422321 zyh A Aug. 11, 2014, 12:49 a.m. OK GNU C++ TESTS 38 15 0 1800
7106997 eddy1021 A July 15, 2014, 7:56 a.m. OK GNU C++ TESTS 38 15 0 1800
7035988 wangyisong1996 A July 6, 2014, 11:13 p.m. OK GNU C++ TESTS 38 15 0 1800
7025363 hzwer A July 6, 2014, 1:38 p.m. OK GNU C++ TESTS 38 15 0 1800
7021836 LoneFox A July 6, 2014, 1:10 p.m. OK GNU C++ TESTS 38 15 0 1800
7074307 shigule A July 13, 2014, 12:51 p.m. OK GNU C++ TESTS 38 15 716800 1800
7026283 Vigoss A July 6, 2014, 1:46 p.m. OK GNU C++ TESTS 38 15 1024000 1800
28859713 Scut82 A July 24, 2017, 11:38 p.m. OK GNU C++ TESTS 38 15 2150400 1800
42071340 Scut82 A Aug. 25, 2018, 12:52 a.m. OK GNU C++ TESTS 38 30 0 1800
7023451 wxkend1997 A July 6, 2014, 1:22 p.m. OK GNU C++ TESTS 38 30 0 1800
7025542 MinakoKojima A July 6, 2014, 1:39 p.m. OK GNU C++0x TESTS 38 15 409600 1800
7071849 bill125 A July 13, 2014, 3:56 a.m. OK GNU C++0x TESTS 38 30 0 1800
7022751 johannesk A July 6, 2014, 1:17 p.m. OK GNU C++0x TESTS 38 31 0 1800
7073546 Xellos A July 13, 2014, 10:28 a.m. OK GNU C++0x TESTS 38 31 0 1800
7064447 sergioRG A July 11, 2014, 3:28 p.m. OK GNU C++0x TESTS 38 31 0 1800
7023733 step5 A July 6, 2014, 1:24 p.m. OK GNU C++0x TESTS 38 31 0 1800
7023533 darrenhp A July 6, 2014, 1:23 p.m. OK GNU C++0x TESTS 38 31 0 1800
7023442 kha A July 6, 2014, 1:22 p.m. OK GNU C++0x TESTS 38 31 0 1800
7022893 stan A July 6, 2014, 1:18 p.m. OK GNU C++0x TESTS 38 31 0 1800
7022852 alex_world A July 6, 2014, 1:18 p.m. OK GNU C++0x TESTS 38 31 0 1800
57948396 rainboy A July 29, 2019, 3:19 p.m. OK GNU C11 TESTS 38 46 0 1800
21235156 blutrex A Oct. 6, 2016, 1:08 p.m. OK GNU C++11 TESTS 38 15 0 1800
46446894 Dilute A Dec. 1, 2018, 1:57 p.m. OK GNU C++11 TESTS 38 30 0 1800
52811466 menjiantong A April 16, 2019, 8:59 a.m. OK GNU C++11 TESTS 38 31 0 1800
51956776 FAQmother A March 29, 2019, 3:11 a.m. OK GNU C++11 TESTS 38 31 0 1800
49035246 PHarr A Jan. 27, 2019, 2:42 a.m. OK GNU C++11 TESTS 38 31 0 1800
49034858 luogu_bot5 A Jan. 27, 2019, 2:24 a.m. OK GNU C++11 TESTS 38 31 0 1800
49033975 luogu_bot1 A Jan. 27, 2019, 1:38 a.m. OK GNU C++11 TESTS 38 31 0 1800
46446860 Dilute A Dec. 1, 2018, 1:57 p.m. OK GNU C++11 TESTS 38 31 0 1800
15278433 god A Jan. 10, 2016, 9:47 a.m. OK GNU C++11 TESTS 38 31 0 1800
61603417 luogu_bot3 A Oct. 1, 2019, 11:53 a.m. OK GNU C++11 TESTS 38 31 0 1800
24095089 DEGwer A Jan. 24, 2017, 4:04 p.m. OK GNU C++14 TESTS 38 46 1945600 1800
66899653 autumn_eel A Dec. 15, 2019, 4:43 a.m. OK GNU C++14 TESTS 38 62 0 1800
60847144 bnmd A Sept. 19, 2019, 12:54 p.m. OK GNU C++14 TESTS 38 62 0 1800
48213037 ppsking A Jan. 11, 2019, 1:08 p.m. OK GNU C++14 TESTS 38 62 204800 1800
51776311 Maruf_75 A March 23, 2019, 10:10 p.m. OK GNU C++14 TESTS 38 62 204800 1800
28574832 after A July 15, 2017, 1:45 p.m. OK GNU C++14 TESTS 38 62 1945600 1800
37426126 n_dao107 A April 18, 2018, 6:13 a.m. OK GNU C++14 TESTS 38 62 4710400 1800
30995168 SmokeOut A Oct. 4, 2017, 2:55 p.m. OK GNU C++14 TESTS 38 77 0 1800
27828072 Yousef_Salama A June 16, 2017, 3:05 p.m. OK GNU C++14 TESTS 38 77 0 1800
47840101 NotNight A Jan. 2, 2019, 11:21 a.m. OK GNU C++14 TESTS 38 77 1024000 1800
59906803 xzt220 A Sept. 2, 2019, 3:42 p.m. OK GNU C++17 TESTS 38 62 0 1800
69886619 Captain_Knuckles A Jan. 31, 2020, 8:27 a.m. OK GNU C++17 TESTS 38 62 409600 1800
60451424 HeRaNO A Sept. 12, 2019, 4:06 p.m. OK GNU C++17 TESTS 38 77 0 1800
64792284 Lower_Rating A Nov. 13, 2019, 11:39 a.m. OK GNU C++17 TESTS 38 77 0 1800
59557306 Momegil A Aug. 27, 2019, 6:50 a.m. OK GNU C++17 TESTS 38 77 0 1800
51902226 Catmoonlight A March 27, 2019, 1:55 p.m. OK GNU C++17 TESTS 38 77 204800 1800
39772924 Bassel A June 29, 2018, 3:58 p.m. OK GNU C++17 TESTS 38 78 0 1800
46979443 anuragsingh804 A Dec. 13, 2018, 6:42 p.m. OK GNU C++17 TESTS 38 78 0 1800
69398788 ST_C A Jan. 23, 2020, 7:32 a.m. OK GNU C++17 TESTS 38 78 409600 1800
64793553 C20193116xq A Nov. 13, 2019, 12:05 p.m. OK GNU C++17 TESTS 38 78 1536000 1800
7034595 Thomas_Ahle A July 6, 2014, 6:06 p.m. OK Go TESTS 38 389 102400 1800
7033285 cojna A July 6, 2014, 3:46 p.m. OK Haskell TESTS 38 62 3174400 1800
12110612 behzad.nouri A July 18, 2015, 8:55 p.m. OK Haskell TESTS 38 78 11776000 1800
9335717 xiaowuc1 A Dec. 31, 2014, 8:57 p.m. OK Java 6 TESTS 38 124 0 1800
7023711 codexile A July 6, 2014, 1:24 p.m. OK Java 6 TESTS 38 124 102400 1800
7544908 mkirsche A Aug. 21, 2014, 3 p.m. OK Java 6 TESTS 38 187 102400 1800
9150013 marcose18 A Dec. 16, 2014, 10:45 a.m. OK Java 6 TESTS 38 545 0 1800
7038167 haruki57 A July 7, 2014, 6:30 a.m. OK Java 6 TESTS 38 561 102400 1800
7373645 NabiNaga A Aug. 8, 2014, 6:06 a.m. OK Java 7 TESTS 38 77 0 1800
7029252 uwi A July 6, 2014, 2:21 p.m. OK Java 7 TESTS 38 93 0 1800
8891865 trunghieu11 A Nov. 29, 2014, 3:20 p.m. OK Java 7 TESTS 38 108 0 1800
7025569 qwerty787788 A July 6, 2014, 1:39 p.m. OK Java 7 TESTS 38 109 0 1800
7022609 simenl A July 6, 2014, 1:16 p.m. OK Java 7 TESTS 38 109 0 1800
7440672 upsolving A Aug. 13, 2014, 8:53 a.m. OK Java 7 TESTS 38 124 0 1800
7440139 Armenoid A Aug. 13, 2014, 7:54 a.m. OK Java 7 TESTS 38 124 0 1800
7111956 Junior94 A July 15, 2014, 9:36 p.m. OK Java 7 TESTS 38 124 0 1800
7104091 PlayLikeNeverB4 A July 14, 2014, 10:09 p.m. OK Java 7 TESTS 38 124 0 1800
7039836 alibaba A July 7, 2014, 10:11 a.m. OK Java 7 TESTS 38 124 0 1800
12322592 hama-du A Aug. 3, 2015, 7:37 a.m. OK Java 8 TESTS 38 124 0 1800
10992290 poikniok A May 4, 2015, 3:31 a.m. OK Java 8 TESTS 38 124 0 1800
19734645 ankurverma1994 A Aug. 8, 2016, 6:34 p.m. OK Java 8 TESTS 38 140 20992000 1800
41536837 KulikAlex A Aug. 12, 2018, 6:25 p.m. OK Java 8 TESTS 38 155 0 1800
38311927 Golmol A May 16, 2018, 7:04 a.m. OK Java 8 TESTS 38 155 20684800 1800
20539794 pitfall A Sept. 11, 2016, 8:33 p.m. OK Java 8 TESTS 38 171 0 1800
9505176 Aidos A Jan. 22, 2015, 6:24 p.m. OK Java 8 TESTS 38 171 0 1800
9228643 fnch A Dec. 22, 2014, 10:49 p.m. OK Java 8 TESTS 38 171 0 1800
7101938 Pimpom A July 14, 2014, 2:59 p.m. OK Java 8 TESTS 38 171 1740800 1800
24013058 _dp A Jan. 21, 2017, 2:13 p.m. OK Java 8 TESTS 38 171 20582400 1800
7033700 azukun A July 6, 2014, 4:18 p.m. OK MS C# TESTS 38 186 11059200 1800
7101562 mjy0503 A July 14, 2014, 2:12 p.m. OK MS C++ TESTS 38 31 0 1800
9666967 LVA007 A Feb. 1, 2015, 3:04 p.m. OK MS C++ TESTS 38 46 0 1800
8613761 Auster A Nov. 8, 2014, 11:16 a.m. OK MS C++ TESTS 38 46 0 1800
8084919 szh123 A Oct. 5, 2014, 12:17 p.m. OK MS C++ TESTS 38 46 0 1800
7684470 Mosyagin A Sept. 4, 2014, 7:57 p.m. OK MS C++ TESTS 38 46 0 1800
7683015 VolodymyrK A Sept. 4, 2014, 3:22 p.m. OK MS C++ TESTS 38 46 0 1800
7285189 Valentin_E A July 29, 2014, 12:54 p.m. OK MS C++ TESTS 38 46 0 1800
7099925 vjudge1 A July 14, 2014, 11:23 a.m. OK MS C++ TESTS 38 46 0 1800
7098458 Vanek A July 14, 2014, 8:20 a.m. OK MS C++ TESTS 38 46 0 1800
7067070 QProgS A July 12, 2014, 5:41 a.m. OK MS C++ TESTS 38 46 0 1800
7153309 Darooha A July 19, 2014, 2:34 a.m. OK Ocaml TESTS 38 93 204800 1800
7503102 jhcmonroy A Aug. 18, 2014, 5:31 p.m. OK Perl TESTS 38 280 0 1800
35862419 ______i______ A March 2, 2018, 10:25 p.m. OK Perl TESTS 38 296 2150400 1800
35872647 ______u______ A March 3, 2018, 7:16 a.m. OK Perl TESTS 38 296 2150400 1800
35872409 ______n______ A March 3, 2018, 7:10 a.m. OK Perl TESTS 38 296 2150400 1800
35871798 _____k_____ A March 3, 2018, 6:58 a.m. OK Perl TESTS 38 296 2150400 1800
35871796 _____i_____ A March 3, 2018, 6:58 a.m. OK Perl TESTS 38 296 2150400 1800
35862969 ______h______ A March 2, 2018, 10:36 p.m. OK Perl TESTS 38 296 2150400 1800
35862752 ______k______ A March 2, 2018, 10:31 p.m. OK Perl TESTS 38 296 2150400 1800
35860720 ______M______ A March 2, 2018, 9:48 p.m. OK Perl TESTS 38 296 2150400 1800
15914413 not_bot_but_POT A Feb. 9, 2016, 1:44 p.m. OK Perl TESTS 38 312 0 1800
7034556 sha384 A July 6, 2014, 6:01 p.m. OK PHP TESTS 38 248 0 1800
10627119 white.cat A April 8, 2015, 4:21 a.m. OK PHP TESTS 38 280 0 1800
7047766 mayakin A July 8, 2014, 2:02 p.m. OK PHP TESTS 38 343 11468800 1800
40123881 Patiala_Peg A July 9, 2018, 3:54 p.m. OK PyPy 2 TESTS 38 483 2560000 1800
34524842 golikovnik A Jan. 24, 2018, 5:46 p.m. OK PyPy 3 TESTS 38 358 27545600 1800
7258075 nwi A July 27, 2014, 3:01 p.m. OK Python 2 TESTS 38 374 0 1800
7029419 Bubbler A July 6, 2014, 2:23 p.m. OK Python 2 TESTS 38 389 11980800 1800
7727612 fcbruce A Sept. 9, 2014, 11:24 a.m. OK Python 2 TESTS 38 405 0 1800
11385343 brodo A June 2, 2015, 3:43 a.m. OK Python 2 TESTS 38 405 2048000 1800
7023661 terribleimposter A July 6, 2014, 1:24 p.m. OK Python 2 TESTS 38 405 2252800 1800
7095917 slowboris2go A July 14, 2014, 2:09 a.m. OK Python 2 TESTS 38 436 0 1800
8711829 windautume A Nov. 16, 2014, 2:38 p.m. OK Python 2 TESTS 38 436 2252800 1800
7443051 olive A Aug. 13, 2014, 1:46 p.m. OK Python 2 TESTS 38 436 2252800 1800
7054461 v.haralampiev A July 9, 2014, 5:21 p.m. OK Python 2 TESTS 38 451 2252800 1800
9499679 SurenNihalani A Jan. 22, 2015, 7:58 a.m. OK Python 2 TESTS 38 467 2252800 1800
7024993 Toxic A July 6, 2014, 1:34 p.m. OK Python 3 TESTS 38 483 0 1800
7057832 ershov.stanislav A July 10, 2014, 9:48 a.m. OK Python 3 TESTS 38 498 0 1800
7937440 andreihh A Sept. 24, 2014, 2:32 p.m. OK Python 3 TESTS 38 499 10035200 1800
7256494 yugle7 A July 27, 2014, 9:54 a.m. OK Python 3 TESTS 38 514 0 1800
7061891 cinderela A July 11, 2014, 6:02 a.m. OK Python 3 TESTS 38 529 0 1800
7030465 jasperH A July 6, 2014, 2:39 p.m. OK Python 3 TESTS 38 530 0 1800
42000595 Mk_Python_v1 A Aug. 23, 2018, 2:53 p.m. OK Python 3 TESTS 38 530 0 1800
7179935 kostka A July 19, 2014, 9:22 p.m. OK Python 3 TESTS 38 639 0 1800
7022787 chaotic_iak A July 6, 2014, 1:17 p.m. OK Python 3 TESTS 38 639 0 1800
7036267 sakuya A July 7, 2014, 12:41 a.m. OK Python 3 TESTS 38 655 0 1800
7074043 Lapenkov A July 13, 2014, 12:14 p.m. OK Ruby TESTS 38 452 0 1800
7660663 hama-du A Sept. 1, 2014, 12:29 p.m. OK Scala TESTS 38 811 9318400 1800

remove filters

Back to search problems