Codeforces Round 481 (Div. 3)

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
978 Codeforces Round 481 (Div. 3) FINISHED False 9000 205620899 May 13, 2018, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9604 ) E Bus Video System PROGRAMMING combinatorics math 1400

B'The busses in Berland are equipped with a video surveillance system. The system records information about changes in the number of passengers in a bus after stops. If x is the number of passengers in a bus just before the current bus stop and y is the number of passengers in the bus just after current bus stop, the system records the number y-x . So the system records show how number of passengers changed. The test run was made for single bus and n bus stops. Thus, the system recorded the sequence of integers a_1, a_2, ... , a_n (exactly one number for each bus stop), where a_i is the record for the bus stop i . The bus stops are numbered from 1 to n in chronological order. Determine the number of possible ways how many people could be in the bus before the first bus stop, if the bus has a capacity equals to w (that is, at any time in the bus there should be from 0 to w passengers inclusive). The first line contains two integers n and w (1 <= n <= 1 ,000, 1 <= w <= 10^{9}) -- the number of bus stops and the capacity of the bus. The second line contains a sequence a_1, a_2, ... , a_n (-10^{6} <= a_i <= 10^{6}) , where a_i equals to the number, which has been recorded by the video system after the i -th bus stop. Print the number of possible ways how many people could be in the bus before the first bus stop, if the bus has a capacity equals to w . If the situation is contradictory (i.e. for any initial number of passengers there will be a contradiction), print 0. In the first example initially in the bus could be 0 , 1 or 2 passengers. In the second example initially in the bus could be 1 , 2 , 3 or 4 passengers. In the third example initially in the bus could be 0 or 1 passenger. '...

Tutorials

T

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
46189787 shenqihao E Nov. 25, 2018, 3:43 a.m. OK Clang++17 Diagnostics TESTS 42 46 0 1400
46194307 shenqihao E Nov. 25, 2018, 7:25 a.m. OK Clang++17 Diagnostics TESTS 42 46 0 1400
38646817 LoveuLostu E May 27, 2018, 4:12 a.m. OK FPC TESTS 42 30 0 1400
40508640 chaorenhaha E July 18, 2018, 9:48 a.m. OK FPC TESTS 42 31 0 1400
40508838 chaorenhaha E July 18, 2018, 9:52 a.m. OK FPC TESTS 42 31 0 1400
51920864 thiennhanui123 E March 28, 2019, 4:13 a.m. OK FPC TESTS 42 31 102400 1400
40773694 chaorenhaha E July 26, 2018, 10 a.m. OK FPC TESTS 42 31 819200 1400
51919885 phongan105 E March 28, 2019, 3:09 a.m. OK FPC TESTS 42 31 921600 1400
38883044 C1ariS E June 2, 2018, 10:19 a.m. OK GNU C TESTS 42 15 3379200 1400
39130240 Swapnil007 E June 10, 2018, 7:18 p.m. OK GNU C TESTS 42 30 0 1400
39130256 Swapnil007 E June 10, 2018, 7:19 p.m. OK GNU C TESTS 42 31 0 1400
38893873 xiao-xiao E June 2, 2018, 2:26 p.m. OK GNU C TESTS 42 31 3379200 1400
38874977 xiaobaicai E June 2, 2018, 5:46 a.m. OK GNU C TESTS 42 31 3379200 1400
41516605 vjudge5 E Aug. 12, 2018, 6:32 a.m. OK GNU C++ TESTS 42 15 0 1400
39146021 vjudge2 E June 11, 2018, 12:18 p.m. OK GNU C++ TESTS 42 15 0 1400
38559642 vjudge5 E May 23, 2018, 11:14 a.m. OK GNU C++ TESTS 42 15 102400 1400
38826113 linners E June 1, 2018, 11:23 a.m. OK GNU C++ TESTS 42 15 3481600 1400
41893394 vjudge2 E Aug. 20, 2018, 8:13 a.m. OK GNU C++ TESTS 42 30 0 1400
41246777 Scut82 E Aug. 5, 2018, 1:33 p.m. OK GNU C++ TESTS 42 30 0 1400
40730675 vjudge5 E July 25, 2018, 7:28 a.m. OK GNU C++ TESTS 42 30 0 1400
39984292 vjudge1 E July 5, 2018, 12:35 p.m. OK GNU C++ TESTS 42 30 0 1400
39459636 .counter E June 21, 2018, 11:07 a.m. OK GNU C++ TESTS 42 30 0 1400
39206489 ccutsoftacm20170521 E June 13, 2018, 5:08 a.m. OK GNU C++ TESTS 42 30 0 1400
51478395 Noshin_1703086 E March 19, 2019, 10:17 a.m. OK GNU C11 TESTS 42 31 0 1400
65875482 torque_459 E Nov. 27, 2019, 4:52 p.m. OK GNU C11 TESTS 42 31 0 1400
69181321 mth1908 E Jan. 20, 2020, 10:16 a.m. OK GNU C11 TESTS 42 31 0 1400
58669226 wander_dog E Aug. 12, 2019, 1:44 p.m. OK GNU C11 TESTS 42 31 0 1400
58910124 akash19jain E Aug. 16, 2019, 12:45 p.m. OK GNU C11 TESTS 42 31 0 1400
43031087 vjudge5 E Sept. 18, 2018, 11:41 a.m. OK GNU C11 TESTS 42 31 307200 1400
66564923 cdza E Dec. 9, 2019, 9:11 p.m. OK GNU C11 TESTS 42 31 3174400 1400
66645185 racerS E Dec. 11, 2019, 4:25 p.m. OK GNU C11 TESTS 42 31 3174400 1400
38644805 vjudge5 E May 27, 2018, 12:10 a.m. OK GNU C++11 TESTS 42 15 0 1400
39357266 Doctorkay E June 18, 2018, 1:23 p.m. OK GNU C++11 TESTS 42 15 0 1400
39451692 wilson.ho E June 21, 2018, 5:15 a.m. OK GNU C++11 TESTS 42 15 0 1400
38559396 frzhi E May 23, 2018, 11:03 a.m. OK GNU C++11 TESTS 42 15 1126400 1400
40917557 smallcute E July 29, 2018, 12:38 p.m. OK GNU C++11 TESTS 42 30 0 1400
61588759 Fahim_Ahmed_Shojib E Oct. 1, 2019, 6:10 a.m. OK GNU C++11 TESTS 42 30 0 1400
57615661 DavidLescano E July 24, 2019, 1:21 a.m. OK GNU C++11 TESTS 42 30 0 1400
44674265 tlnllkbp E Oct. 22, 2018, 1:44 a.m. OK GNU C++11 TESTS 42 30 0 1400
41918029 Bo12138 E Aug. 21, 2018, 1:09 a.m. OK GNU C++11 TESTS 42 30 0 1400
41627034 LuuKhanhTung E Aug. 15, 2018, 3:07 p.m. OK GNU C++11 TESTS 42 30 0 1400
52758953 Mr_Math E April 14, 2019, 7:03 p.m. OK GNU C++14 TESTS 42 15 0 1400
53423284 GeorgeRaouf E April 27, 2019, 12:28 p.m. OK GNU C++14 TESTS 42 15 0 1400
54329593 SarsHawk E May 18, 2019, 5:05 a.m. OK GNU C++14 TESTS 42 15 0 1400
58123850 vjudge4 E Aug. 1, 2019, 11:52 a.m. OK GNU C++14 TESTS 42 15 0 1400
58533557 pipapipo E Aug. 10, 2019, 10:46 a.m. OK GNU C++14 TESTS 42 15 0 1400
58866411 aj4941 E Aug. 15, 2019, 1:32 p.m. OK GNU C++14 TESTS 42 15 0 1400
60256782 NamSPro E Sept. 8, 2019, 9:44 a.m. OK GNU C++14 TESTS 42 15 0 1400
66198079 Wild4Stone E Dec. 2, 2019, 7:23 p.m. OK GNU C++14 TESTS 42 15 0 1400
68013327 Bondo E Dec. 31, 2019, 5 p.m. OK GNU C++14 TESTS 42 15 0 1400
69083483 Bazigar E Jan. 19, 2020, 7:23 a.m. OK GNU C++14 TESTS 42 15 0 1400
46915986 Boxer E Dec. 11, 2018, 8:27 p.m. OK GNU C++17 TESTS 42 15 0 1400
58503007 System.in.me E Aug. 9, 2019, 3:07 p.m. OK GNU C++17 TESTS 42 15 0 1400
56826803 code_tamer E July 11, 2019, 4:53 a.m. OK GNU C++17 TESTS 42 15 0 1400
54649434 MitI_7 E May 26, 2019, 4:06 a.m. OK GNU C++17 TESTS 42 15 0 1400
54587578 Harshil_Goti_2209 E May 25, 2019, 7:28 a.m. OK GNU C++17 TESTS 42 15 0 1400
54417032 fumiphys E May 20, 2019, 1:11 p.m. OK GNU C++17 TESTS 42 15 0 1400
52757738 AhmedEzzatG E April 14, 2019, 6:11 p.m. OK GNU C++17 TESTS 42 15 0 1400
51079485 SamuelLim E March 9, 2019, 10:42 a.m. OK GNU C++17 TESTS 42 15 0 1400
47394019 Qudratxoja.Musayev E Dec. 23, 2018, 10 a.m. OK GNU C++17 TESTS 42 15 0 1400
46963488 anay2102 E Dec. 13, 2018, 9:49 a.m. OK GNU C++17 TESTS 42 15 0 1400
47794381 AndreBtt E Dec. 31, 2018, 3:41 p.m. OK Go TESTS 42 31 0 1400
38552255 only_methol E May 23, 2018, 5:51 a.m. OK Go TESTS 42 31 5529600 1400
42913366 Marii E Sept. 16, 2018, 8:19 a.m. OK Go TESTS 42 46 0 1400
59685983 Agnimandur E Aug. 30, 2019, 1:33 a.m. OK Java 8 TESTS 42 109 0 1400
69566500 luchy0120 E Jan. 26, 2020, 12:37 p.m. OK Java 8 TESTS 42 109 0 1400
68888687 GiantTornado E Jan. 16, 2020, 12:31 a.m. OK Java 8 TESTS 42 109 0 1400
57910422 MohammadHossam E July 28, 2019, 7:49 p.m. OK Java 8 TESTS 42 109 0 1400
57504501 vanhohenheim E July 22, 2019, 11:31 a.m. OK Java 8 TESTS 42 109 0 1400
55850086 the41 E June 21, 2019, 2:50 a.m. OK Java 8 TESTS 42 109 0 1400
50981637 alibaba E March 7, 2019, 6:02 p.m. OK Java 8 TESTS 42 109 0 1400
47856663 rogernadal E Jan. 2, 2019, 11:25 p.m. OK Java 8 TESTS 42 109 0 1400
58926118 TheYoussef E Aug. 16, 2019, 7:36 p.m. OK Java 8 TESTS 42 124 0 1400
63118373 sakt_coder E Oct. 22, 2019, 10:17 a.m. OK Java 8 TESTS 42 124 0 1400
41245160 stepanovep E Aug. 5, 2018, 12:41 p.m. OK Kotlin TESTS 42 187 0 1400
39694010 sarim E June 27, 2018, 7:23 a.m. OK Mono C# TESTS 42 46 102400 1400
60294212 nadilk E Sept. 9, 2019, 9:09 a.m. OK Mono C# TESTS 42 62 3686400 1400
50073665 _SHREDDER_ E Feb. 17, 2019, 7:26 p.m. OK Mono C# TESTS 42 62 3686400 1400
52376878 nemars E April 6, 2019, 8:34 a.m. OK Mono C# TESTS 42 62 3686400 1400
57346269 idkanythingx2 E July 19, 2019, 11:21 p.m. OK Mono C# TESTS 42 62 3686400 1400
68644143 hibatibati E Jan. 12, 2020, 8:29 a.m. OK Mono C# TESTS 42 77 3686400 1400
57346276 friendou E July 19, 2019, 11:22 p.m. OK Mono C# TESTS 42 77 3788800 1400
48798393 vjudge3 E Jan. 23, 2019, 1:29 p.m. OK MS C++ TESTS 42 15 0 1400
38558294 cloudx E May 23, 2018, 10:19 a.m. OK MS C++ TESTS 42 15 307200 1400
38647830 vjudge4 E May 27, 2018, 5:35 a.m. OK MS C++ TESTS 42 30 0 1400
38649081 vjudge3 E May 27, 2018, 6:45 a.m. OK MS C++ TESTS 42 30 0 1400
38648977 vjudge3 E May 27, 2018, 6:40 a.m. OK MS C++ TESTS 42 30 0 1400
38649258 vjudge1 E May 27, 2018, 6:54 a.m. OK MS C++ TESTS 42 30 0 1400
38685728 MrFog E May 28, 2018, 6:07 a.m. OK MS C++ TESTS 42 30 0 1400
39593560 j4357j E June 24, 2018, 7:25 a.m. OK MS C++ TESTS 42 30 0 1400
53892806 vjudge1 E May 9, 2019, 2:28 a.m. OK MS C++ TESTS 42 30 0 1400
68300802 vjudge1 E Jan. 6, 2020, 6:26 a.m. OK MS C++ TESTS 42 30 0 1400
54835675 0-jij-0 E May 30, 2019, 10:49 a.m. OK MS C++ 2017 TESTS 42 31 0 1400
50585235 work_hard. E Feb. 28, 2019, 2:50 a.m. OK MS C++ 2017 TESTS 42 31 0 1400
51095805 NPUlzh E March 9, 2019, 4:21 p.m. OK MS C++ 2017 TESTS 42 31 0 1400
68301887 vjudge2 E Jan. 6, 2020, 7:04 a.m. OK MS C++ 2017 TESTS 42 31 0 1400
61591174 Mad112233 E Oct. 1, 2019, 7:04 a.m. OK MS C++ 2017 TESTS 42 31 0 1400
61215011 ICboom E Sept. 24, 2019, 12:29 p.m. OK MS C++ 2017 TESTS 42 31 0 1400
58858836 Denko E Aug. 15, 2019, 10:42 a.m. OK MS C++ 2017 TESTS 42 31 0 1400
58331606 Abugozah E Aug. 5, 2019, 9:36 a.m. OK MS C++ 2017 TESTS 42 31 0 1400
57506455 Still_Theory E July 22, 2019, 12:12 p.m. OK MS C++ 2017 TESTS 42 31 0 1400
63308917 Dmitry1_q1 E Oct. 24, 2019, 3:19 p.m. OK MS C++ 2017 TESTS 42 31 307200 1400
48797683 vjudge4 E Jan. 23, 2019, 1:15 p.m. OK Node.js TESTS 42 155 1331200 1400
38786513 frmsaul E May 30, 2018, 11:16 p.m. OK PyPy 2 TESTS 42 93 23142400 1400
67670701 AnandOza E Dec. 26, 2019, 8:15 p.m. OK PyPy 2 TESTS 42 124 0 1400
39445788 kevinsogo E June 20, 2018, 8:33 p.m. OK PyPy 3 TESTS 42 109 0 1400
38882547 piyushkumarmaurya E June 2, 2018, 10:07 a.m. OK PyPy 3 TESTS 42 109 21401600 1400
38710072 zjuwyz E May 29, 2018, 5:45 a.m. OK PyPy 3 TESTS 42 124 0 1400
56064527 Sevlll E June 26, 2019, 7:15 a.m. OK PyPy 3 TESTS 42 124 102400 1400
58570496 brosucks E Aug. 11, 2019, 9:56 a.m. OK PyPy 3 TESTS 42 139 0 1400
69636638 swguy E Jan. 27, 2020, 6:47 p.m. OK PyPy 3 TESTS 42 140 0 1400
69376755 pratiikgoogler E Jan. 22, 2020, 6:23 p.m. OK PyPy 3 TESTS 42 140 0 1400
69185986 mythos E Jan. 20, 2020, 11:57 a.m. OK PyPy 3 TESTS 42 140 0 1400
68957628 gaidash E Jan. 16, 2020, 9:12 p.m. OK PyPy 3 TESTS 42 140 0 1400
57873954 diduk001 E July 28, 2019, 3:57 a.m. OK PyPy 3 TESTS 42 140 0 1400
39537535 Quirinius E June 23, 2018, 9:41 a.m. OK Python 2 TESTS 42 109 102400 1400
39944935 Lasers67 E July 4, 2018, 6:55 a.m. OK Python 2 TESTS 42 171 0 1400
39886441 gnagar1996 E July 3, 2018, 7:30 a.m. OK Python 2 TESTS 42 171 0 1400
40184079 __dangerous__ E July 10, 2018, 10:41 p.m. OK Python 2 TESTS 42 202 0 1400
39267822 KAin0 E June 15, 2018, 1:43 p.m. OK Python 3 TESTS 42 77 0 1400
38971815 libra8z E June 5, 2018, 2:48 p.m. OK Python 3 TESTS 42 78 7065600 1400
38679536 cristi.dana3 E May 27, 2018, 8:31 p.m. OK Python 3 TESTS 42 92 0 1400
38678609 cristi.dana3 E May 27, 2018, 7:42 p.m. OK Python 3 TESTS 42 92 0 1400
39190793 Vasiliy_48 E June 12, 2018, 12:06 p.m. OK Python 3 TESTS 42 93 0 1400
38713654 MajAK E May 29, 2018, 8:53 a.m. OK Python 3 TESTS 42 93 0 1400
38688573 phalguna1306 E May 28, 2018, 8:36 a.m. OK Python 3 TESTS 42 93 0 1400
39001751 Anemone E June 6, 2018, 6:22 p.m. OK Python 3 TESTS 42 93 102400 1400
38703726 megaspazz E May 28, 2018, 8:08 p.m. OK Python 3 TESTS 42 93 102400 1400
38678043 cristi.dana2 E May 27, 2018, 7:25 p.m. OK Python 3 TESTS 42 108 0 1400
38560243 blazeva1 E May 23, 2018, 11:37 a.m. OK Rust TESTS 42 31 716800 1400
41547249 kobae964 E Aug. 13, 2018, 6:06 a.m. OK Rust TESTS 42 31 105164800 1400
46716275 yakamoto E Dec. 7, 2018, 11:24 a.m. OK Scala TESTS 42 389 0 1400
41566862 sam.ninja E Aug. 13, 2018, 6:02 p.m. OK Scala TESTS 42 530 0 1400

remove filters

Back to search problems