Codeforces Beta Round 48

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
51 Codeforces Beta Round 48 FINISHED False 9000 482853623 Dec. 28, 2010, 4 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 453 ) E Pentagon PROGRAMMING combinatorics graphs matrices 2300

According to the last order issued by the president of Berland every city of the country must have its own Ministry Defense building (their own Pentagon). A megapolis Berbourg was not an exception. This city has n junctions, some pairs of which are connected by two-way roads. Overall there are m roads in the city, no more than one between each pair of junctions. At the moment choosing a location place for Pentagon in Berbourg is being discussed. It has been decided that Pentagon should cover the territory of five different junctions which are joined into a cycle by roads. In the order to build Pentagon a special wall will be built along the roads (with high-tension razor, high-voltage wire and other attributes). Thus, the number of possible ways of building Pentagon in the city is equal to the number of different cycles at lengths of 5, composed of junctions and roads. Your task is to prints the number of ways of building Pentagon in Berbourg. Only well-optimized solutions will be accepted. Please, test your code on the maximal testcase. The first line contains two integers n and m ( 1 ≤ n ≤ 700;0 ≤ m ≤ n ·( n - 1) / 2 ), where n represents the number of junctions and m is the number of roads in the city. Then follow m lines containing the road descriptions, one in each line. Every road is set by a number of integers a i , b i ( 1 ≤ a i , b i ≤ n ; a i ≠ b i ), where a i and b i represent the numbers of junctions, connected by the road. The junctions are numbered from 1 to n . It is not guaranteed that from any junction one can get to any other one moving along the roads. Print the single number which represents the required number of ways. Please, do not use %lld specificator to read or write 64-bit integers in C++. It is preffered to use cout (also you may use %I64d ).

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
232373 tourist E Dec. 28, 2010, 4:53 p.m. OK Delphi TESTS 45 4340 8908800 2300
3430728 vlad107 E April 1, 2013, 12:18 p.m. OK Delphi TESTS 45 5750 3072000 2300
3430747 vlad107 E April 1, 2013, 12:21 p.m. OK FPC TESTS 45 3046 3072000 2300
233665 Sereja E Dec. 28, 2010, 6:03 p.m. OK FPC TESTS 45 3700 4710400 2300
235849 Ultimate E Dec. 30, 2010, 3:53 p.m. OK FPC TESTS 45 4720 3379200 2300
475349 opiekacz E June 3, 2011, 8:13 p.m. OK GNU C++ TESTS 45 560 7270400 2300
1175097 Archon.JK E Feb. 13, 2012, 5:40 a.m. OK GNU C++ TESTS 45 660 7270400 2300
10992641 WindIncarnation E May 4, 2015, 5:12 a.m. OK GNU C++ TESTS 45 746 5734400 2300
40993251 ReaLNero1 E July 31, 2018, 1:51 a.m. OK GNU C++ TESTS 45 748 5734400 2300
235789 watashi E Dec. 30, 2010, 6:54 a.m. OK GNU C++ TESTS 45 890 7372800 2300
235786 watashi E Dec. 30, 2010, 6:51 a.m. OK GNU C++ TESTS 45 890 9318400 2300
1175096 Archon.JK E Feb. 13, 2012, 5:40 a.m. OK GNU C++ TESTS 45 1170 7270400 2300
11528660 miskcoo E June 11, 2015, 7:14 a.m. OK GNU C++ TESTS 45 1216 5939200 2300
13812731 130705009 E Oct. 23, 2015, 5:15 p.m. OK GNU C++ TESTS 45 1248 5939200 2300
235782 watashi E Dec. 30, 2010, 6:38 a.m. OK GNU C++ TESTS 45 1450 15360000 2300
4274737 littlepanda E Aug. 13, 2013, 7:49 p.m. OK GNU C++0x TESTS 45 3368 2560000 2300
8697810 aliasadiiii E Nov. 14, 2014, 8:12 p.m. OK GNU C++0x TESTS 45 8422 19968000 2300
48435964 KMAASZRAA E Jan. 15, 2019, 8:29 p.m. OK GNU C++11 TESTS 45 592 46182400 2300
48435883 KMAASZRAA E Jan. 15, 2019, 8:24 p.m. OK GNU C++11 TESTS 45 622 46182400 2300
17083459 freebsdx E April 1, 2016, 1:39 a.m. OK GNU C++11 TESTS 45 1184 8089600 2300
46112435 jangjie E Nov. 23, 2018, 12:28 p.m. OK GNU C++11 TESTS 45 1310 5836800 2300
48435985 KMAASZRAA E Jan. 15, 2019, 8:30 p.m. OK GNU C++11 TESTS 45 1404 46182400 2300
20092415 2016 E Aug. 23, 2016, 6:46 p.m. OK GNU C++11 TESTS 45 1434 8192000 2300
52168554 GNAQ E April 1, 2019, 3:33 p.m. OK GNU C++11 TESTS 45 1622 4608000 2300
47866983 quhengyi11 E Jan. 3, 2019, 10:25 a.m. OK GNU C++11 TESTS 45 1652 6041600 2300
69889637 YLWang E Jan. 31, 2020, 9:32 a.m. OK GNU C++11 TESTS 45 1684 6041600 2300
64289499 yqlm E Nov. 5, 2019, 6:26 a.m. OK GNU C++11 TESTS 45 1840 7270400 2300
48399196 .ckodser. E Jan. 14, 2019, 7:36 p.m. OK GNU C++14 TESTS 45 1122 7987200 2300
23621819 Ali.Pi E Jan. 7, 2017, 10:31 a.m. OK GNU C++14 TESTS 45 1372 7782400 2300
48398977 .ckodser. E Jan. 14, 2019, 7:27 p.m. OK GNU C++14 TESTS 45 1528 8192000 2300
31607082 -Morass- E Oct. 22, 2017, 2:48 p.m. OK GNU C++14 TESTS 45 1590 6041600 2300
38191255 I_love_chickpea E May 13, 2018, 12:58 p.m. OK GNU C++14 TESTS 45 1808 28569600 2300
54853160 Hahahahahahahhahaha E May 30, 2019, 5:43 p.m. OK GNU C++14 TESTS 45 1838 4812800 2300
53467218 y_men9_dva_po_fizike E April 28, 2019, 10:48 a.m. OK GNU C++14 TESTS 45 1840 2048000 2300
48437043 ArshiaDadras E Jan. 15, 2019, 9:31 p.m. OK GNU C++14 TESTS 45 1870 2048000 2300
48437171 ArshiaDadras E Jan. 15, 2019, 9:38 p.m. OK GNU C++14 TESTS 45 2184 2048000 2300
48437234 ArshiaDadras E Jan. 15, 2019, 9:44 p.m. OK GNU C++14 TESTS 45 3556 2048000 2300
64696261 typhigh E Nov. 11, 2019, 1:25 p.m. OK GNU C++17 TESTS 45 1184 11571200 2300
49755944 kenimo E Feb. 11, 2019, 6:23 a.m. OK GNU C++17 TESTS 45 1558 4198400 2300
53467205 y_men9_dva_po_fizike E April 28, 2019, 10:48 a.m. OK GNU C++17 TESTS 45 1902 2048000 2300
58329329 DavitMarg E Aug. 5, 2019, 8:50 a.m. OK GNU C++17 TESTS 45 2058 3993600 2300
43108889 hyfzbtrs E Sept. 20, 2018, 10:34 a.m. OK GNU C++17 TESTS 45 3556 12185600 2300
51450639 ivan100sic E March 18, 2019, 2:34 p.m. OK GNU C++17 TESTS 45 3804 19660800 2300
46034534 redotter E Nov. 21, 2018, 3:33 p.m. OK GNU C++17 TESTS 45 6082 8294400 2300
38121314 ruo E May 11, 2018, 6:24 p.m. OK GNU C++17 TESTS 45 8984 15564800 2300
233092 Egor E Dec. 28, 2010, 5:31 p.m. OK Java 6 TESTS 45 2170 43315200 2300
236014 Hadi_Asiaie E Jan. 1, 2011, 9:23 p.m. OK Java 6 TESTS 45 4000 43315200 2300
232808 ivan.popelyshev E Dec. 28, 2010, 5:15 p.m. OK Java 6 TESTS 45 4560 43315200 2300
236013 Hadi_Asiaie E Jan. 1, 2011, 9:13 p.m. OK Java 6 TESTS 45 4610 43315200 2300
236015 Hadi_Asiaie E Jan. 1, 2011, 9:27 p.m. OK Java 6 TESTS 45 5280 43315200 2300
937181 uwi E Dec. 9, 2011, 12:37 p.m. OK Java 6 TESTS 45 5840 42905600 2300
2407903 Azat_Yusupov E Oct. 22, 2012, 10:40 a.m. OK Java 6 TESTS 45 6218 0 2300
235143 it4.kp E Dec. 28, 2010, 11:32 p.m. OK Java 6 TESTS 45 9340 43315200 2300
3819422 nipunn1313 E June 3, 2013, 4:56 p.m. OK Java 6 TESTS 45 9890 17203200 2300
234691 TomConerly E Dec. 28, 2010, 7:38 p.m. OK Java 6 TESTS 45 9940 57958400 2300
2746945 niyaznigmatul E Dec. 10, 2012, 11:23 a.m. OK Java 7 TESTS 45 5031 0 2300
5959072 qwerty787788 E March 7, 2014, 7:20 p.m. OK Java 7 TESTS 45 9264 0 2300
236012 Hadi_Asiaie E Jan. 1, 2011, 9:09 p.m. OK Mono C# TESTS 45 9000 12800000 2300
233219 Anton_Lunyov E Dec. 28, 2010, 5:38 p.m. OK MS C++ TESTS 45 520 7372800 2300
235788 watashi E Dec. 30, 2010, 6:53 a.m. OK MS C++ TESTS 45 1130 7372800 2300
235855 Hadi_Asiaie E Dec. 30, 2010, 4:10 p.m. OK MS C++ TESTS 45 2220 10342400 2300
233849 Shtrix E Dec. 28, 2010, 6:12 p.m. OK MS C++ TESTS 45 2530 5427200 2300
473892 Icemore E June 1, 2011, 10:56 a.m. OK MS C++ TESTS 45 2670 7065600 2300
234855 MBabin E Dec. 28, 2010, 8:11 p.m. OK MS C++ TESTS 45 3060 6144000 2300
23924943 stostap E Jan. 18, 2017, 2:50 p.m. OK MS C++ TESTS 45 3118 4608000 2300
246683 luckyi E Jan. 11, 2011, 1:11 p.m. OK MS C++ TESTS 45 3270 5427200 2300
235860 Hadi_Asiaie E Dec. 30, 2010, 4:17 p.m. OK MS C++ TESTS 45 3390 14336000 2300
243829 Psilocybe E Jan. 10, 2011, 2:31 p.m. OK MS C++ TESTS 45 3560 9216000 2300
58258420 DavitMarg E Aug. 4, 2019, 11:09 a.m. OK MS C++ 2017 TESTS 45 1994 3993600 2300

remove filters

Back to search problems