Codeforces Round 386 (Div. 2)

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
746 Codeforces Round 386 (Div. 2) FINISHED False 9000 294348323 Dec. 18, 2016, 10:35 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 3854 ) C Tram PROGRAMMING constructive algorithms implementation math 1600

The tram in Berland goes along a straight line from the point 0 to the point s and back, passing 1 meter per t 1 seconds in both directions. It means that the tram is always in the state of uniform rectilinear motion, instantly turning around at points x = 0 and x = s . Igor is at the point x 1 . He should reach the point x 2 . Igor passes 1 meter per t 2 seconds. Your task is to determine the minimum time Igor needs to get from the point x 1 to the point x 2 , if it is known where the tram is and in what direction it goes at the moment Igor comes to the point x 1 . Igor can enter the tram unlimited number of times at any moment when his and the tram's positions coincide. It is not obligatory that points in which Igor enter and exit the tram are integers. Assume that any boarding and unboarding happens instantly. Igor can move arbitrary along the line (but not faster than 1 meter per t 2 seconds). He can also stand at some point for some time. The first line contains three integers s , x 1 and x 2 ( 2 ≤ s ≤ 1000 , 0 ≤ x 1 , x 2 ≤ s , x 1 ≠ x 2 ) — the maximum coordinate of the point to which the tram goes, the point Igor is at, and the point he should come to. The second line contains two integers t 1 and t 2 ( 1 ≤ t 1 , t 2 ≤ 1000 ) — the time in seconds in which the tram passes 1 meter and the time in seconds in which Igor passes 1 meter. The third line contains two integers p and d ( 1 ≤ p ≤ s - 1 , d is either 1 or ) — the position of the tram in the moment Igor came to the point x 1 and the direction of the tram at this moment. If , the tram goes in the direction from the point s to the point 0 . If d = 1 , the tram goes in the direction from the point 0 to the point s . Print the minimum time in seconds which Igor needs to get from the point x 1 to the point x 2 . In the first example it is profitable for Igor to go by foot and not to wait the tram. Thus, he has to pass 2 meters and it takes 8 seconds in total, because he passes 1 meter per 4 seconds

Tutorials

Codeforces Round #386 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
23111850 StarScreamOwl C Dec. 18, 2016, 5:39 p.m. OK Delphi TESTS 47 15 2560000 1600
29822462 KagamiharaNadeshiko C Aug. 27, 2017, 8:58 a.m. OK FPC TESTS 47 15 102400 1600
23108843 andrew C Dec. 18, 2016, 3:23 p.m. OK FPC TESTS 47 15 1638400 1600
23103126 mostcleverboy C Dec. 18, 2016, 12:58 p.m. OK FPC TESTS 47 15 1638400 1600
23671678 romanfixture1404 C Jan. 9, 2017, 10:11 p.m. OK FPC TESTS 47 15 1638400 1600
23358353 KiberGraf C Dec. 27, 2016, 11:50 a.m. OK FPC TESTS 47 15 1638400 1600
23113197 Zeron C Dec. 18, 2016, 6:45 p.m. OK FPC TESTS 47 15 1638400 1600
23111294 thongchuthanh2000 C Dec. 18, 2016, 5:12 p.m. OK FPC TESTS 47 15 1638400 1600
23110158 nguyenthanhbrt C Dec. 18, 2016, 4:18 p.m. OK FPC TESTS 47 15 1638400 1600
23511827 gadalov C Jan. 3, 2017, 7:39 a.m. OK FPC TESTS 47 15 1740800 1600
23356348 Gray_58 C Dec. 27, 2016, 9:43 a.m. OK FPC TESTS 47 15 1740800 1600
26886736 Udit_Maniyar C May 5, 2017, 6:14 p.m. OK GNU C TESTS 47 15 0 1600
23877477 vjudge2 C Jan. 16, 2017, 8:39 a.m. OK GNU C TESTS 47 15 1843200 1600
23832312 vjudge5 C Jan. 15, 2017, 6:54 a.m. OK GNU C TESTS 47 15 1843200 1600
23832309 Champagne C Jan. 15, 2017, 6:54 a.m. OK GNU C TESTS 47 15 1843200 1600
23636261 rishabh24196 C Jan. 7, 2017, 8:09 p.m. OK GNU C TESTS 47 15 1843200 1600
23173626 jkxjkx1031 C Dec. 20, 2016, 9:22 a.m. OK GNU C TESTS 47 15 1843200 1600
23106137 Radon12 C Dec. 18, 2016, 2 p.m. OK GNU C TESTS 47 15 1843200 1600
27940820 ahmed127011 C June 21, 2017, 8:27 a.m. OK GNU C TESTS 47 15 1945600 1600
27939784 ahmed127011 C June 21, 2017, 7:40 a.m. OK GNU C TESTS 47 15 1945600 1600
25339745 codemart786 C March 8, 2017, 11:23 a.m. OK GNU C TESTS 47 15 1945600 1600
30961311 vjudge2 C Oct. 3, 2017, 7:50 a.m. OK GNU C++ TESTS 47 15 0 1600
30961177 vjudge4 C Oct. 3, 2017, 7:44 a.m. OK GNU C++ TESTS 47 15 0 1600
30959764 vjudge3 C Oct. 3, 2017, 6:33 a.m. OK GNU C++ TESTS 47 15 0 1600
30867454 rc_4594 C Sept. 30, 2017, 1:14 p.m. OK GNU C++ TESTS 47 15 0 1600
30763228 ziad.khobeiz C Sept. 26, 2017, 8:50 p.m. OK GNU C++ TESTS 47 15 0 1600
30633870 vjudge4 C Sept. 23, 2017, 7:08 a.m. OK GNU C++ TESTS 47 15 0 1600
30633621 vjudge4 C Sept. 23, 2017, 6:54 a.m. OK GNU C++ TESTS 47 15 0 1600
30630462 fanyining C Sept. 23, 2017, 5:10 a.m. OK GNU C++ TESTS 47 15 0 1600
30630383 vjudge5 C Sept. 23, 2017, 5:03 a.m. OK GNU C++ TESTS 47 15 0 1600
30628450 vjudge3 C Sept. 23, 2017, 2:25 a.m. OK GNU C++ TESTS 47 15 0 1600
23137157 noob_coder_v2 C Dec. 19, 2016, 11:39 a.m. OK GNU C11 TESTS 47 15 1843200 1600
23108301 somu1997 C Dec. 18, 2016, 3:02 p.m. OK GNU C11 TESTS 47 15 1843200 1600
24285137 vjudge5 C Jan. 31, 2017, 8:49 a.m. OK GNU C11 TESTS 47 15 1843200 1600
23108344 somu1997 C Dec. 18, 2016, 3:03 p.m. OK GNU C11 TESTS 47 15 1945600 1600
23174670 vjudge4 C Dec. 20, 2016, 10:29 a.m. OK GNU C11 TESTS 47 15 1945600 1600
46768524 2018030401093 C Dec. 8, 2018, 3:37 p.m. OK GNU C11 TESTS 47 31 0 1600
46768559 vjudge2 C Dec. 8, 2018, 3:38 p.m. OK GNU C11 TESTS 47 31 0 1600
31215398 QuanQqqqq C Oct. 11, 2017, 12:03 p.m. OK GNU C++11 TESTS 47 15 0 1600
32511863 MarioBassem C Nov. 20, 2017, 9:41 p.m. OK GNU C++11 TESTS 47 15 0 1600
32353182 Omar C Nov. 16, 2017, 11:17 a.m. OK GNU C++11 TESTS 47 15 0 1600
31930118 herculan27 C Oct. 31, 2017, 6:12 p.m. OK GNU C++11 TESTS 47 15 0 1600
31239249 seddik11 C Oct. 12, 2017, 11:27 a.m. OK GNU C++11 TESTS 47 15 0 1600
31006070 _MahmudovJovid_ C Oct. 5, 2017, 2:40 a.m. OK GNU C++11 TESTS 47 15 0 1600
30628109 vjudge2 C Sept. 23, 2017, 1:54 a.m. OK GNU C++11 TESTS 47 15 0 1600
30329502 Lauran C Sept. 14, 2017, 1:25 p.m. OK GNU C++11 TESTS 47 15 0 1600
30290972 Shavkat_Aminov C Sept. 12, 2017, 4:21 p.m. OK GNU C++11 TESTS 47 15 0 1600
30230513 minson123 C Sept. 9, 2017, 4:57 p.m. OK GNU C++11 TESTS 47 15 0 1600
32508212 AmmarElshamy C Nov. 20, 2017, 6:14 p.m. OK GNU C++14 TESTS 47 15 0 1600
39425839 pratikgk45 C June 20, 2018, 4:13 a.m. OK GNU C++14 TESTS 47 15 0 1600
39647309 ___Bob___ C June 25, 2018, 11:08 a.m. OK GNU C++14 TESTS 47 15 0 1600
40092685 Anu_coder C July 8, 2018, 6:25 p.m. OK GNU C++14 TESTS 47 15 0 1600
48604137 risings C Jan. 20, 2019, 9:52 a.m. OK GNU C++14 TESTS 47 15 0 1600
52067469 wh1te_whale C March 31, 2019, 6:14 a.m. OK GNU C++14 TESTS 47 15 0 1600
32133026 __Darkmoon C Nov. 8, 2017, 2:05 a.m. OK GNU C++14 TESTS 47 15 0 1600
31814788 AbdelrahmanEldakrony C Oct. 27, 2017, 5:49 p.m. OK GNU C++14 TESTS 47 15 0 1600
32199128 George.Samuel C Nov. 10, 2017, 3:33 p.m. OK GNU C++14 TESTS 47 15 0 1600
39143020 OmarFouad C June 11, 2018, 10:25 a.m. OK GNU C++14 TESTS 47 15 0 1600
53197375 Essam C April 23, 2019, 4:05 p.m. OK GNU C++17 TESTS 47 15 0 1600
68995567 jeeba_leepa C Jan. 17, 2020, 5:15 p.m. OK GNU C++17 TESTS 47 15 0 1600
57776276 baremin C July 26, 2019, 3:42 a.m. OK GNU C++17 TESTS 47 15 204800 1600
35167829 limn2o4 C Feb. 12, 2018, 3:50 a.m. OK GNU C++17 TESTS 47 15 1945600 1600
57010340 abhishekroy98 C July 14, 2019, 8:54 a.m. OK GNU C++17 TESTS 47 30 0 1600
61820410 k24 C Oct. 4, 2019, 1:59 a.m. OK GNU C++17 TESTS 47 30 0 1600
60700616 jalalium C Sept. 16, 2019, 11:47 p.m. OK GNU C++17 TESTS 47 30 0 1600
59616535 vjudge4 C Aug. 28, 2019, 12:53 p.m. OK GNU C++17 TESTS 47 30 0 1600
57557002 Abdelrahman_Mohammed C July 22, 2019, 8:26 p.m. OK GNU C++17 TESTS 47 30 0 1600
56962236 dsalkdsalkjds C July 13, 2019, 7:03 a.m. OK GNU C++17 TESTS 47 30 0 1600
23113393 Nesze C Dec. 18, 2016, 6:54 p.m. OK Go TESTS 47 15 22937600 1600
23105966 Mr.Kutso C Dec. 18, 2016, 1:57 p.m. OK Go TESTS 47 15 23040000 1600
63283284 120405217 C Oct. 24, 2019, 9:25 a.m. OK Go TESTS 47 31 0 1600
23244454 cojna C Dec. 23, 2016, 9:43 a.m. OK Haskell TESTS 47 15 44953600 1600
23107139 Omar_Morsi C Dec. 18, 2016, 2:24 p.m. OK Java 8 TESTS 47 108 20275200 1600
23107286 entick11 C Dec. 18, 2016, 2:28 p.m. OK Java 8 TESTS 47 108 20582400 1600
59502728 danielgalvis98 C Aug. 26, 2019, 4:01 a.m. OK Java 8 TESTS 47 109 0 1600
55598176 the41 C June 15, 2019, 4:22 p.m. OK Java 8 TESTS 47 109 0 1600
46559410 Suzukaze C Dec. 3, 2018, 7:17 p.m. OK Java 8 TESTS 47 109 0 1600
46469306 chojh1222 C Dec. 2, 2018, 6:30 a.m. OK Java 8 TESTS 47 109 0 1600
46468717 chojh1222 C Dec. 2, 2018, 6:01 a.m. OK Java 8 TESTS 47 109 0 1600
30808212 Jeel_Vaishnav C Sept. 28, 2017, 2:47 p.m. OK Java 8 TESTS 47 109 0 1600
30769688 zodiacleo C Sept. 27, 2017, 6:56 a.m. OK Java 8 TESTS 47 109 0 1600
29697702 sugnay C Aug. 23, 2017, 4:35 a.m. OK Java 8 TESTS 47 109 0 1600
54556144 HusseinHroub C May 24, 2019, 11:43 a.m. OK Mono C# TESTS 47 46 0 1600
54556267 HusseinHroub C May 24, 2019, 11:46 a.m. OK Mono C# TESTS 47 46 0 1600
68109734 hibatibati C Jan. 3, 2020, 9:01 a.m. OK Mono C# TESTS 47 62 1740800 1600
53809206 iamanvesh C May 6, 2019, 4:54 a.m. OK Mono C# TESTS 47 62 3584000 1600
23386570 secret6a C Dec. 28, 2016, 8:36 p.m. OK Mono C# TESTS 47 62 9011200 1600
23170771 marshmallow C Dec. 20, 2016, 6:20 a.m. OK MS C# TESTS 47 62 9113600 1600
23112735 og.kostya C Dec. 18, 2016, 6:23 p.m. OK MS C# TESTS 47 77 9011200 1600
24326614 spelmasta C Jan. 31, 2017, 8:04 p.m. OK MS C# TESTS 47 77 9113600 1600
23215733 BigMax C Dec. 22, 2016, 1:30 a.m. OK MS C# TESTS 47 77 11264000 1600
23361549 diequeeq C Dec. 27, 2016, 3:02 p.m. OK MS C# TESTS 47 77 11571200 1600
23215472 BigMax C Dec. 22, 2016, 12:49 a.m. OK MS C# TESTS 47 93 11264000 1600
30960791 vjudge5 C Oct. 3, 2017, 7:25 a.m. OK MS C++ TESTS 47 15 204800 1600
30959990 vjudge3 C Oct. 3, 2017, 6:46 a.m. OK MS C++ TESTS 47 15 204800 1600
30959534 vjudge3 C Oct. 3, 2017, 6:20 a.m. OK MS C++ TESTS 47 15 204800 1600
30959327 vjudge4 C Oct. 3, 2017, 6:08 a.m. OK MS C++ TESTS 47 15 204800 1600
24910309 Ally0729 C Feb. 23, 2017, 7:17 a.m. OK MS C++ TESTS 47 15 2048000 1600
28685566 vjudge1 C July 19, 2017, 5:50 a.m. OK MS C++ TESTS 47 15 2048000 1600
34655912 vjudge3 C Jan. 29, 2018, 8:51 a.m. OK MS C++ TESTS 47 15 2048000 1600
34655926 febr30th C Jan. 29, 2018, 8:52 a.m. OK MS C++ TESTS 47 15 2048000 1600
25405445 vjudge3 C March 11, 2017, 12:56 p.m. OK MS C++ TESTS 47 15 2048000 1600
25707882 ovProphet C March 22, 2017, 9:58 a.m. OK MS C++ TESTS 47 15 2048000 1600
55822290 bansalkanha68 C June 20, 2019, 9:09 a.m. OK MS C++ 2017 TESTS 47 31 0 1600
52939926 ecjtu18-1224 C April 18, 2019, 8:39 a.m. OK MS C++ 2017 TESTS 47 31 0 1600
23116817 tacocat C Dec. 19, 2016, 12:06 a.m. OK Ocaml TESTS 47 15 3788800 1600
23106856 mayakin C Dec. 18, 2016, 2:16 p.m. OK PHP TESTS 47 31 6041600 1600
25724131 Trunks C March 23, 2017, 12:45 a.m. OK PyPy 2 TESTS 47 77 22016000 1600
23107671 0101-1001 C Dec. 18, 2016, 2:41 p.m. OK PyPy 2 TESTS 47 77 22016000 1600
34182549 vjudge1 C Jan. 14, 2018, 6:26 p.m. OK PyPy 3 TESTS 47 78 19968000 1600
32937073 vjudge4 C Dec. 4, 2017, 11:28 p.m. OK PyPy 3 TESTS 47 109 23040000 1600
23655264 clarinet758 C Jan. 8, 2017, 6:45 p.m. OK PyPy 3 TESTS 47 124 23347200 1600
58250000 Doxapar C Aug. 4, 2019, 7:23 a.m. OK PyPy 3 TESTS 47 140 0 1600
57952640 Evil__Coder C July 29, 2019, 5:11 p.m. OK PyPy 3 TESTS 47 140 0 1600
68752675 nguyenthanhhai1069 C Jan. 14, 2020, 7:14 a.m. OK PyPy 3 TESTS 47 155 0 1600
58162763 Kadtsin_vs C Aug. 2, 2019, 8 a.m. OK PyPy 3 TESTS 47 155 0 1600
52534224 Mr.Inconsistent C April 9, 2019, 2:49 p.m. OK PyPy 3 TESTS 47 155 307200 1600
23183072 cugel C Dec. 20, 2016, 6:32 p.m. OK PyPy 3 TESTS 47 155 23142400 1600
53440926 limabeans C April 28, 2019, 12:05 a.m. OK PyPy 3 TESTS 47 296 6144000 1600
23166720 DKCode C Dec. 19, 2016, 11:40 p.m. OK Python 2 TESTS 47 46 4710400 1600
23107341 jian1573 C Dec. 18, 2016, 2:30 p.m. OK Python 2 TESTS 47 46 4710400 1600
23382928 weapon_x C Dec. 28, 2016, 5:18 p.m. OK Python 2 TESTS 47 61 4608000 1600
23193624 lagarwal C Dec. 21, 2016, 7:56 a.m. OK Python 2 TESTS 47 61 4608000 1600
31043509 7amasa C Oct. 5, 2017, 6:03 p.m. OK Python 2 TESTS 47 62 0 1600
24427057 slonmudrosti C Feb. 4, 2017, 7:45 a.m. OK Python 2 TESTS 47 62 4608000 1600
23687047 alooparatha C Jan. 10, 2017, 7:35 p.m. OK Python 2 TESTS 47 62 4608000 1600
23271513 dsharma080 C Dec. 24, 2016, 12:29 p.m. OK Python 2 TESTS 47 62 4608000 1600
23263953 tjytlxwxhyzqfw C Dec. 24, 2016, 5:26 a.m. OK Python 2 TESTS 47 62 4608000 1600
23128900 aleksey.gaydukov C Dec. 19, 2016, 4:46 a.m. OK Python 2 TESTS 47 62 4608000 1600
23131813 pcchou C Dec. 19, 2016, 7:11 a.m. OK Python 3 TESTS 47 61 4608000 1600
31260771 yugle7 C Oct. 12, 2017, 9:15 p.m. OK Python 3 TESTS 47 62 0 1600
27828860 sushantgupta4 C June 16, 2017, 3:49 p.m. OK Python 3 TESTS 47 62 0 1600
23978496 Black_Fregat C Jan. 20, 2017, 3:18 a.m. OK Python 3 TESTS 47 62 4608000 1600
23207286 nns2009 C Dec. 21, 2016, 7:03 p.m. OK Python 3 TESTS 47 62 4608000 1600
23202340 Maxim.Greek C Dec. 21, 2016, 3:09 p.m. OK Python 3 TESTS 47 62 4608000 1600
23136723 aleksandr C Dec. 19, 2016, 11:19 a.m. OK Python 3 TESTS 47 62 4608000 1600
23111683 gokjer C Dec. 18, 2016, 5:32 p.m. OK Python 3 TESTS 47 62 4608000 1600
23110722 Q-learning C Dec. 18, 2016, 4:46 p.m. OK Python 3 TESTS 47 62 4608000 1600
23106979 aboura C Dec. 18, 2016, 2:20 p.m. OK Python 3 TESTS 47 62 4608000 1600
23112230 Ramadoka. C Dec. 18, 2016, 5:57 p.m. OK Ruby TESTS 47 62 6451200 1600
26904862 ASoboll C May 6, 2017, 3:38 p.m. OK Scala TESTS 47 249 0 1600

remove filters

Back to search problems