Educational Codeforces Round 31

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
884 Educational Codeforces Round 31 FINISHED False 7200 228412523 Oct. 27, 2017, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4825 ) C Bertown Subway PROGRAMMING dfs and similar greedy math 1500

B"The construction of subway in Bertown is almost finished! The President of Berland will visit this city soon to look at the new subway himself. There are n stations in the subway. It was built according to the Bertown Transport Law: The President will consider the convenience of subway after visiting it. The convenience is the number of ordered pairs (x, xe2 x80 x89y) such that person can start at station x and, after taking some subway trains (possibly zero), arrive at station y (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x, xe2 x80 x89y xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). The mayor of Bertown thinks that if the subway is not convenient enough, then the President might consider installing a new mayor (and, of course, the current mayor doesn't want it to happen). Before President visits the city mayor has enough time to rebuild some paths of subway, thus changing the values of pi for not more than two subway stations. Of course, breaking the Bertown Transport Law is really bad, so the subway must be built according to the Law even after changes. The mayor wants to do these changes in such a way that the convenience of the subway is maximized. Help him to calculate the maximum possible convenience he can get! The first line contains one integer number n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100000) -- the number of stations. The second line contains n integer numbers p1, p2, ..., pn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- the current structure of the subway. All these numbers are distinct. Print one number -- the maximum possible value of convenience. In the first example the mayor can change p2 to 3 and p3 to 1, so there will be 9 pairs: (1, xe2 x80 x891), (1, xe2 x80 x892), (1, xe2 x80 x893), (2, xe2 x80 x891), (2, xe2 x80 x892), (2, xe2 x80 x893), (3, xe2 x80 x891), (3, xe2 x80 x892), (3, xe2 x80 x893). In the second example the mayor can change p2 to 4 and p3 to 5. "...

Tutorials

55470

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
31807958 ruban C Oct. 27, 2017, 3:23 p.m. OK Delphi TESTS 27 31 32051200 1500
32136139 rabbitcxk C Nov. 8, 2017, 10:14 a.m. OK FPC TESTS 27 31 1024000 1500
32519057 nhatdanbgvt C Nov. 21, 2017, 7:57 a.m. OK FPC TESTS 27 31 1024000 1500
32733982 Zilant C Nov. 27, 2017, 7:39 p.m. OK FPC TESTS 27 31 3174400 1500
31805812 slavik228 C Oct. 27, 2017, 2:59 p.m. OK FPC TESTS 27 31 3379200 1500
31942622 MrLolthe1st C Nov. 1, 2017, 8:24 a.m. OK FPC TESTS 27 31 3379200 1500
31808273 __peossp C Oct. 27, 2017, 3:27 p.m. OK FPC TESTS 27 46 2560000 1500
32007573 Faimerth C Nov. 3, 2017, 12:49 p.m. OK GNU C TESTS 27 30 7987200 1500
32101815 8897360799 C Nov. 6, 2017, 5:20 p.m. OK GNU C TESTS 27 31 819200 1500
32072251 gaelim C Nov. 5, 2017, 9:32 a.m. OK GNU C TESTS 27 31 819200 1500
31810578 xzm2020 C Oct. 27, 2017, 3:58 p.m. OK GNU C TESTS 27 31 1228800 1500
31808529 Yash_Agarwal C Oct. 27, 2017, 3:31 p.m. OK GNU C TESTS 27 31 1228800 1500
39793609 narutohokage C June 30, 2018, 9:43 a.m. OK GNU C TESTS 27 31 1638400 1500
31813520 yashk C Oct. 27, 2017, 5:07 p.m. OK GNU C TESTS 27 31 1638400 1500
32441533 mhmazidi4 C Nov. 18, 2017, 8:25 p.m. OK GNU C TESTS 27 31 2662400 1500
31939599 gaelim C Nov. 1, 2017, 6:23 a.m. OK GNU C TESTS 27 31 3993600 1500
32822258 practice_00 C Dec. 1, 2017, 6:05 a.m. OK GNU C TESTS 27 31 4403200 1500
32003834 shiyilang C Nov. 3, 2017, 10:10 a.m. OK GNU C++ TESTS 27 15 512000 1500
31802550 lzr_010506 C Oct. 27, 2017, 2:29 p.m. OK GNU C++ TESTS 27 15 819200 1500
31877424 anno C Oct. 29, 2017, 9:15 p.m. OK GNU C++ TESTS 27 15 921600 1500
31898858 wzp666 C Oct. 30, 2017, 3:56 p.m. OK GNU C++ TESTS 27 15 1228800 1500
31915826 Scut82 C Oct. 31, 2017, 9:28 a.m. OK GNU C++ TESTS 27 15 1331200 1500
35077255 251 C Feb. 9, 2018, 4 a.m. OK GNU C++ TESTS 27 15 2560000 1500
31803314 MSF_Akatsuki C Oct. 27, 2017, 2:35 p.m. OK GNU C++ TESTS 27 15 3891200 1500
32203069 aboAdnan C Nov. 10, 2017, 6:25 p.m. OK GNU C++ TESTS 27 30 512000 1500
31948808 Alleria C Nov. 1, 2017, 12:03 p.m. OK GNU C++ TESTS 27 30 512000 1500
32428782 KMAASZRAA C Nov. 18, 2017, 11:21 a.m. OK GNU C++ TESTS 27 30 1228800 1500
31812992 AMMS C Oct. 27, 2017, 4:50 p.m. OK GNU C11 TESTS 27 30 1228800 1500
53197612 rainboy C April 23, 2019, 4:12 p.m. OK GNU C11 TESTS 27 31 512000 1500
31848118 FarhoodRostamkhani C Oct. 28, 2017, 6:40 p.m. OK GNU C11 TESTS 27 31 819200 1500
31805475 j3soon C Oct. 27, 2017, 2:56 p.m. OK GNU C11 TESTS 27 31 819200 1500
31842791 tabac C Oct. 28, 2017, 3:25 p.m. OK GNU C11 TESTS 27 31 1740800 1500
31800429 __math C Oct. 27, 2017, 2:16 p.m. OK GNU C++11 TESTS 27 15 409600 1500
31799616 eddy1021 C Oct. 27, 2017, 2:12 p.m. OK GNU C++11 TESTS 27 15 512000 1500
31800991 Umi C Oct. 27, 2017, 2:18 p.m. OK GNU C++11 TESTS 27 15 512000 1500
31821968 annihilation666 C Oct. 28, 2017, 1:17 a.m. OK GNU C++11 TESTS 27 15 819200 1500
31801570 cuizhuyefei C Oct. 27, 2017, 2:22 p.m. OK GNU C++11 TESTS 27 15 921600 1500
31833890 niike0goood C Oct. 28, 2017, 11:26 a.m. OK GNU C++11 TESTS 27 15 1024000 1500
31872919 RccHD C Oct. 29, 2017, 5:05 p.m. OK GNU C++11 TESTS 27 15 1638400 1500
31800778 snowflake C Oct. 27, 2017, 2:17 p.m. OK GNU C++11 TESTS 27 15 4505600 1500
32094881 PupilFop_zz C Nov. 6, 2017, 12:02 p.m. OK GNU C++11 TESTS 27 15 6041600 1500
31976372 Wubaizhe C Nov. 2, 2017, 10:54 a.m. OK GNU C++11 TESTS 27 30 307200 1500
31854259 LiChenKoh C Oct. 29, 2017, 2:45 a.m. OK GNU C++14 TESTS 27 15 512000 1500
31814632 Egor.Lifar C Oct. 27, 2017, 5:43 p.m. OK GNU C++14 TESTS 27 15 512000 1500
32135550 FizzyDavid C Nov. 8, 2017, 9:01 a.m. OK GNU C++14 TESTS 27 15 614400 1500
31802714 flukehn C Oct. 27, 2017, 2:30 p.m. OK GNU C++14 TESTS 27 15 921600 1500
31847722 _AjReme_ C Oct. 28, 2017, 6:26 p.m. OK GNU C++14 TESTS 27 15 3993600 1500
32154437 wjw1340 C Nov. 9, 2017, 9:50 a.m. OK GNU C++14 TESTS 27 30 819200 1500
32329380 twangal C Nov. 15, 2017, 11 a.m. OK GNU C++14 TESTS 27 31 409600 1500
32064376 skayfish C Nov. 4, 2017, 9:58 p.m. OK GNU C++14 TESTS 27 31 409600 1500
32064247 skayfish C Nov. 4, 2017, 9:45 p.m. OK GNU C++14 TESTS 27 31 409600 1500
31979461 Alexit C Nov. 2, 2017, 12:22 p.m. OK GNU C++14 TESTS 27 31 409600 1500
41671907 vjudge2 C Aug. 17, 2018, 5:42 a.m. OK GNU C++17 TESTS 27 30 512000 1500
54007725 vjudge5 C May 11, 2019, 9:33 p.m. OK GNU C++17 TESTS 27 31 614400 1500
57627909 465798176 C July 24, 2019, 7:43 a.m. OK GNU C++17 TESTS 27 46 409600 1500
39518657 DomiKo C June 22, 2018, 2:07 p.m. OK GNU C++17 TESTS 27 46 409600 1500
43098879 laurent.demonet C Sept. 20, 2018, 3:14 a.m. OK GNU C++17 TESTS 27 46 409600 1500
62593261 Anachor C Oct. 14, 2019, 11 p.m. OK GNU C++17 TESTS 27 46 512000 1500
50781351 vjudge2 C March 4, 2019, 11:30 a.m. OK GNU C++17 TESTS 27 46 512000 1500
46921513 LJC00118 C Dec. 12, 2018, 5:21 a.m. OK GNU C++17 TESTS 27 46 512000 1500
52245031 ShJ C April 2, 2019, 6:35 p.m. OK GNU C++17 TESTS 27 46 512000 1500
49677865 exe C Feb. 9, 2019, 9:12 p.m. OK GNU C++17 TESTS 27 46 716800 1500
31998255 megaspazz C Nov. 3, 2017, 6:15 a.m. OK Go TESTS 27 31 204800 1500
31985391 CaptainChrno C Nov. 2, 2017, 3:56 p.m. OK Go TESTS 27 31 1331200 1500
31849657 mishagam C Oct. 28, 2017, 7:54 p.m. OK Go TESTS 27 31 5427200 1500
31996777 norshtein C Nov. 3, 2017, 3:10 a.m. OK Go TESTS 27 93 1331200 1500
31995242 xfce8888 C Nov. 3, 2017, 12:14 a.m. OK Go TESTS 27 93 1331200 1500
31891071 mipt.vi002 C Oct. 30, 2017, 11:11 a.m. OK Haskell TESTS 27 155 31744000 1500
31807398 mipt.vi002 C Oct. 27, 2017, 3:17 p.m. OK Haskell TESTS 27 171 31744000 1500
31869804 daniboybye C Oct. 29, 2017, 2:42 p.m. OK Haskell TESTS 27 280 36966400 1500
31803822 sl0th C Oct. 27, 2017, 2:39 p.m. OK Haskell TESTS 27 530 36966400 1500
53184859 aman28rwt C April 23, 2019, 9:44 a.m. OK Java 8 TESTS 27 109 0 1500
31809029 deepakjain C Oct. 27, 2017, 3:37 p.m. OK Java 8 TESTS 27 109 0 1500
32133023 chojh1222 C Nov. 8, 2017, 2:04 a.m. OK Java 8 TESTS 27 124 0 1500
53198849 Dukkha C April 23, 2019, 4:53 p.m. OK Java 8 TESTS 27 124 0 1500
48494209 wadissimo C Jan. 17, 2019, 12:17 p.m. OK Java 8 TESTS 27 124 0 1500
32154773 wolfor C Nov. 9, 2017, 10:14 a.m. OK Java 8 TESTS 27 124 0 1500
32004326 amriteshpatidar C Nov. 3, 2017, 10:32 a.m. OK Java 8 TESTS 27 124 0 1500
31980776 StayAwayFromBitches C Nov. 2, 2017, 1:05 p.m. OK Java 8 TESTS 27 124 0 1500
31948905 cero C Nov. 1, 2017, 12:06 p.m. OK Java 8 TESTS 27 124 0 1500
31925450 ThatMathGuy C Oct. 31, 2017, 3:09 p.m. OK Java 8 TESTS 27 124 0 1500
31808857 ldt116 C Oct. 27, 2017, 3:35 p.m. OK Kotlin TESTS 27 171 0 1500
31806772 serejkee C Oct. 27, 2017, 3:09 p.m. OK Kotlin TESTS 27 218 6758400 1500
31803520 SlavaG C Oct. 27, 2017, 2:37 p.m. OK Kotlin TESTS 27 234 5120000 1500
31875104 ArgentumWalker C Oct. 29, 2017, 6:53 p.m. OK Kotlin TESTS 27 343 15462400 1500
31807387 heat_wave C Oct. 27, 2017, 3:17 p.m. OK Kotlin TESTS 27 374 6860800 1500
60385712 szechuan_sauce C Sept. 11, 2019, 11:25 a.m. OK Mono C# TESTS 27 124 13516800 1500
31921266 unused C Oct. 31, 2017, 12:40 p.m. OK MS C# TESTS 27 62 1433600 1500
31813107 og.kostya C Oct. 27, 2017, 4:54 p.m. OK MS C# TESTS 27 62 2969600 1500
31805513 artsin666 C Oct. 27, 2017, 2:56 p.m. OK MS C# TESTS 27 62 9216000 1500
33285052 sid0adams C Dec. 16, 2017, 9:31 a.m. OK MS C# TESTS 27 62 18124800 1500
33099083 Mem C Dec. 11, 2017, 10:22 a.m. OK MS C# TESTS 27 77 19865600 1500
31823127 sekiya9311 C Oct. 28, 2017, 3:02 a.m. OK MS C# TESTS 27 92 12697600 1500
31829821 Kirundel C Oct. 28, 2017, 8:55 a.m. OK MS C# TESTS 27 93 13414400 1500
31951011 Egoist_ C Nov. 1, 2017, 1:14 p.m. OK MS C++ TESTS 27 31 614400 1500
32240454 void_sora C Nov. 12, 2017, 10:21 a.m. OK MS C++ TESTS 27 31 921600 1500
32497948 pixxxelolo C Nov. 20, 2017, 11:46 a.m. OK MS C++ TESTS 27 31 1024000 1500
32140693 oraheem C Nov. 8, 2017, 1:17 p.m. OK MS C++ TESTS 27 31 1945600 1500
34255719 scorpiowf C Jan. 17, 2018, 3:27 p.m. OK MS C++ TESTS 27 31 2969600 1500
32851371 vjudge5 C Dec. 2, 2017, 7:42 a.m. OK MS C++ TESTS 27 31 3276800 1500
31808898 LLI_E_P_JI_O_K C Oct. 27, 2017, 3:36 p.m. OK MS C++ TESTS 27 31 3276800 1500
34255622 scorpiowf C Jan. 17, 2018, 3:23 p.m. OK MS C++ TESTS 27 31 3379200 1500
34348492 vjudge4 C Jan. 20, 2018, 10:29 a.m. OK MS C++ TESTS 27 31 4403200 1500
52076476 vjudge4 C March 31, 2019, 10:17 a.m. OK MS C++ TESTS 27 46 512000 1500
52600611 ecjtu18-1224 C April 11, 2019, 11:44 a.m. OK MS C++ 2017 TESTS 27 93 2048000 1500
49937351 nomiku99 C Feb. 15, 2019, 7:56 a.m. OK MS C++ 2017 TESTS 27 108 614400 1500
68636298 vjudge1 C Jan. 12, 2020, 5:57 a.m. OK MS C++ 2017 TESTS 27 108 2662400 1500
32203009 Akulyat C Nov. 10, 2017, 6:22 p.m. OK PascalABC.NET TESTS 27 93 5427200 1500
31931205 s_p C Oct. 31, 2017, 6:55 p.m. OK Perl TESTS 27 202 21094400 1500
31803790 rsFalse C Oct. 27, 2017, 2:39 p.m. OK Perl TESTS 27 217 23142400 1500
31819481 rsFalse C Oct. 27, 2017, 9:10 p.m. OK Perl TESTS 27 264 22425600 1500
31930238 mayakin C Oct. 31, 2017, 6:17 p.m. OK PHP TESTS 27 77 8396800 1500
33744544 nealzane C Dec. 28, 2017, 7:27 p.m. OK PyPy 2 TESTS 27 77 27648000 1500
31808802 Epikem C Oct. 27, 2017, 3:35 p.m. OK PyPy 2 TESTS 27 93 5939200 1500
31807067 abhigyank C Oct. 27, 2017, 3:13 p.m. OK PyPy 2 TESTS 27 93 6451200 1500
35304614 andreamaf C Feb. 15, 2018, 3:10 p.m. OK PyPy 2 TESTS 27 93 28160000 1500
31805549 dbhrockzz C Oct. 27, 2017, 2:56 p.m. OK PyPy 2 TESTS 27 109 6348800 1500
31808584 atulac C Oct. 27, 2017, 3:32 p.m. OK PyPy 2 TESTS 27 109 10854400 1500
31816431 abhinavmathur96 C Oct. 27, 2017, 6:44 p.m. OK PyPy 2 TESTS 27 124 10240000 1500
32565303 latsyrc1123 C Nov. 23, 2017, 3:14 a.m. OK PyPy 2 TESTS 27 139 10342400 1500
49030351 aeternalis1 C Jan. 26, 2019, 9:40 p.m. OK PyPy 2 TESTS 27 140 6451200 1500
31806109 Shunie C Oct. 27, 2017, 3:02 p.m. OK PyPy 2 TESTS 27 140 7884800 1500
36030401 knight-erraunt C March 7, 2018, 12:45 a.m. OK PyPy 3 TESTS 27 140 30924800 1500
31807874 mmaxio C Oct. 27, 2017, 3:22 p.m. OK PyPy 3 TESTS 27 186 7372800 1500
31812326 sergovoy C Oct. 27, 2017, 4:32 p.m. OK PyPy 3 TESTS 27 186 7475200 1500
31909224 TerenceLiu C Oct. 31, 2017, 2:33 a.m. OK PyPy 3 TESTS 27 187 8806400 1500
31996096 freedom_dr C Nov. 3, 2017, 1:56 a.m. OK PyPy 3 TESTS 27 218 7475200 1500
32191096 hqhs C Nov. 10, 2017, 10:19 a.m. OK PyPy 3 TESTS 27 218 13414400 1500
63992566 UTMoonlight C Nov. 1, 2019, 1:36 p.m. OK PyPy 3 TESTS 27 218 15155200 1500
31813098 siddharth.s.atwork C Oct. 27, 2017, 4:54 p.m. OK PyPy 3 TESTS 27 327 15052800 1500
31805299 wangkan2001 C Oct. 27, 2017, 2:54 p.m. OK Python 2 TESTS 27 140 5427200 1500
31940117 asfd221 C Nov. 1, 2017, 6:45 a.m. OK Python 2 TESTS 27 155 9625600 1500
32208920 Tconan C Nov. 11, 2017, 2:06 a.m. OK Python 2 TESTS 27 171 10547200 1500
31969288 franckmy C Nov. 2, 2017, 6:12 a.m. OK Python 2 TESTS 27 186 5324800 1500
31803633 Ferume C Oct. 27, 2017, 2:38 p.m. OK Python 2 TESTS 27 186 5324800 1500
31851190 ReaLNero C Oct. 28, 2017, 9:19 p.m. OK Python 2 TESTS 27 187 5632000 1500
31807637 El_Ectric C Oct. 27, 2017, 3:20 p.m. OK Python 2 TESTS 27 187 5734400 1500
31806287 minhphuoc1998 C Oct. 27, 2017, 3:04 p.m. OK Python 2 TESTS 27 187 7680000 1500
39402717 Ali_Pi C June 19, 2018, 8:01 a.m. OK Python 2 TESTS 27 202 5324800 1500
31851179 ReaLNero C Oct. 28, 2017, 9:19 p.m. OK Python 2 TESTS 27 202 5324800 1500
31812089 sergovoy C Oct. 27, 2017, 4:26 p.m. OK Python 3 TESTS 27 124 7270400 1500
31808667 sunhong C Oct. 27, 2017, 3:33 p.m. OK Python 3 TESTS 27 139 7270400 1500
31880174 Tracing C Oct. 30, 2017, 2:42 a.m. OK Python 3 TESTS 27 140 7270400 1500
32551122 ZakoylovIlya C Nov. 22, 2017, 1:04 p.m. OK Python 3 TESTS 27 155 6758400 1500
32541267 Barnoul C Nov. 22, 2017, 6:08 a.m. OK Python 3 TESTS 27 155 6963200 1500
32541551 werusnik C Nov. 22, 2017, 6:23 a.m. OK Python 3 TESTS 27 155 7065600 1500
31813790 en3ga2 C Oct. 27, 2017, 5:16 p.m. OK Python 3 TESTS 27 155 7065600 1500
31813284 NiakTheWizard C Oct. 27, 2017, 5 p.m. OK Python 3 TESTS 27 155 7065600 1500
32328550 Jiburiru C Nov. 15, 2017, 10:11 a.m. OK Python 3 TESTS 27 155 7270400 1500
32152156 shubply C Nov. 9, 2017, 6:53 a.m. OK Python 3 TESTS 27 155 7270400 1500
32100254 Hillmouse C Nov. 6, 2017, 4:03 p.m. OK Rust TESTS 27 15 2150400 1500
31805670 hatoo C Oct. 27, 2017, 2:58 p.m. OK Rust TESTS 27 30 2048000 1500

remove filters

Back to search problems