Codeforces Round 674 (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
1426 Codeforces Round 674 (Div. 3) FINISHED False 7200 136072511 Sept. 28, 2020, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16298 ) D Non-zero Segments PROGRAMMING constructive algorithms data structures greedy 1500

B"Kolya got an integer array a_1, a_2, ... , a_n . The array can contain both positive and negative integers, but Kolya doesn't like 0 , so the array doesn't contain any zeros. Kolya doesn't like that the sum of some subsegments of his array can be 0 . The subsegment is some consecutive segment of elements of the array. You have to help Kolya and change his array in such a way that it doesn't contain any subsegments with the sum 0 . To reach this goal, you can insert any integers between any pair of adjacent elements of the array (integers can be really any: positive, negative, 0 , any by absolute value, even such a huge that they can't be represented in most standard programming languages). Your task is to find the minimum number of integers you have to insert into Kolya's array in such a way that the resulting array doesn't contain any subsegments with the sum 0 . The first line of the input contains one integer n ( 2 <= n <= 200 ,000 ) -- the number of elements in Kolya's array. The second line of the input contains n integers a_1, a_2, ... , a_n ( -10^{9} <= a_i <= 10^{9}, a_i neq 0 ) -- the description of Kolya's array. Print the minimum number of integers you have to insert into Kolya's array in such a way that the resulting array doesn't contain any subsegments with the sum 0 . Consider the first example. There is only one subsegment with the sum 0 . It starts in the second element and ends in the fourth element. It's enough to insert one element so the array doesn't contain any subsegments with the sum equal to zero. For example, it is possible to insert the integer 1 between second and third elements of the array. There are no subsegments having sum 0 in the second example so you don't need to do anything. "...

Tutorials

83120

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
94114823 qwerasdfzxcl D Sept. 28, 2020, 10:31 a.m. OK GNU C11 TESTS 44 93 19251200 1500
94148077 Rajib_119 D Sept. 28, 2020, 4:28 p.m. OK GNU C++11 TESTS 44 62 8908800 1500
94131916 OceanLiu D Sept. 28, 2020, 1:35 p.m. OK GNU C++11 TESTS 44 77 8089600 1500
94174333 _aether_ D Sept. 29, 2020, 3:35 a.m. OK GNU C++11 TESTS 44 77 11264000 1500
94123855 Bridddd D Sept. 28, 2020, 12:09 p.m. OK GNU C++11 TESTS 44 77 16076800 1500
94122616 Hpnes D Sept. 28, 2020, 11:56 a.m. OK GNU C++11 TESTS 44 77 148275200 1500
94124212 fearlessgao D Sept. 28, 2020, 12:13 p.m. OK GNU C++11 TESTS 44 78 6451200 1500
94169690 TQX D Sept. 29, 2020, 1:09 a.m. OK GNU C++11 TESTS 44 78 8089600 1500
94169660 QwQcOrZ D Sept. 29, 2020, 1:08 a.m. OK GNU C++11 TESTS 44 78 8089600 1500
94132649 Walking_streaky_pork D Sept. 28, 2020, 1:42 p.m. OK GNU C++11 TESTS 44 78 8089600 1500
94122786 Joysh D Sept. 28, 2020, 11:58 a.m. OK GNU C++11 TESTS 44 78 11366400 1500
94143576 TLEsePARESHAN D Sept. 28, 2020, 3:35 p.m. OK GNU C++14 TESTS 44 62 22732800 1500
94178325 tonystark_3000 D Sept. 29, 2020, 5:07 a.m. OK GNU C++14 TESTS 44 93 6144000 1500
94112874 new_user101 D Sept. 28, 2020, 10:16 a.m. OK GNU C++14 TESTS 42 93 7782400 1500
94146977 samar7d D Sept. 28, 2020, 4:14 p.m. OK GNU C++14 TESTS 44 93 8192000 1500
94113687 dg25 D Sept. 28, 2020, 10:21 a.m. OK GNU C++14 TESTS 44 108 6963200 1500
94165738 iprakhar22 D Sept. 28, 2020, 9:59 p.m. OK GNU C++14 TESTS 44 108 8294400 1500
94111244 naughtyb0y D Sept. 28, 2020, 10:06 a.m. OK GNU C++14 TESTS 42 108 8601600 1500
94113102 AbishekSeshan D Sept. 28, 2020, 10:17 a.m. OK GNU C++14 TESTS 42 108 8704000 1500
94133000 Chitra_Singla D Sept. 28, 2020, 1:46 p.m. OK GNU C++14 TESTS 44 108 9420800 1500
94117800 ashty243 D Sept. 28, 2020, 11:05 a.m. OK GNU C++14 TESTS 44 108 9420800 1500
94133166 MTuan D Sept. 28, 2020, 1:48 p.m. OK GNU C++17 TESTS 44 93 4812800 1500
94131981 rbalida1 D Sept. 28, 2020, 1:35 p.m. OK GNU C++17 TESTS 44 93 5939200 1500
94129924 Tirth_Vamja D Sept. 28, 2020, 1:14 p.m. OK GNU C++17 TESTS 44 93 6553600 1500
94169261 -osdajigu- D Sept. 29, 2020, 12:51 a.m. OK GNU C++17 TESTS 44 93 6553600 1500
94177738 V_R D Sept. 29, 2020, 4:54 a.m. OK GNU C++17 TESTS 44 93 6758400 1500
94122388 iamxlr8 D Sept. 28, 2020, 11:54 a.m. OK GNU C++17 TESTS 44 93 7577600 1500
94119305 Gotu D Sept. 28, 2020, 11:21 a.m. OK GNU C++17 TESTS 44 93 7577600 1500
94135177 midhun_martin_ D Sept. 28, 2020, 2:08 p.m. OK GNU C++17 TESTS 44 93 8396800 1500
94112562 eblabrada_ D Sept. 28, 2020, 10:13 a.m. OK GNU C++17 TESTS 42 93 8396800 1500
94142711 g0dzq4 D Sept. 28, 2020, 3:26 p.m. OK GNU C++17 TESTS 44 93 9216000 1500
94133266 Entropt D Sept. 28, 2020, 1:49 p.m. OK GNU C++17 (64) TESTS 44 61 4812800 1500
94144177 kal013 D Sept. 28, 2020, 3:41 p.m. OK GNU C++17 (64) TESTS 44 62 15360000 1500
94141925 noob_26 D Sept. 28, 2020, 3:17 p.m. OK GNU C++17 (64) TESTS 44 77 9523200 1500
94176923 tysm D Sept. 29, 2020, 4:37 a.m. OK GNU C++17 (64) TESTS 44 77 11264000 1500
94164210 Ayalla D Sept. 28, 2020, 9:10 p.m. OK GNU C++17 (64) TESTS 44 77 11264000 1500
94159298 alexssiz1 D Sept. 28, 2020, 7:17 p.m. OK GNU C++17 (64) TESTS 44 77 11264000 1500
94127866 _null_ptr_ D Sept. 28, 2020, 12:53 p.m. OK GNU C++17 (64) TESTS 44 77 13721600 1500
94123907 Hossam D Sept. 28, 2020, 12:10 p.m. OK GNU C++17 (64) TESTS 44 77 13721600 1500
94112789 _BadLoser D Sept. 28, 2020, 10:15 a.m. OK GNU C++17 (64) TESTS 42 77 15360000 1500
94164349 abdisonfire D Sept. 28, 2020, 9:14 p.m. OK GNU C++17 (64) TESTS 44 78 10342400 1500
94171963 synapse D Sept. 29, 2020, 2:31 a.m. OK Go TESTS 44 171 11980800 1500
94150745 codelegend D Sept. 28, 2020, 5 p.m. OK Haskell TESTS 44 733 10649600 1500
94111876 kunalkatiyar9 D Sept. 28, 2020, 10:09 a.m. OK Java 11 TESTS 42 217 4710400 1500
94152963 vidya_99 D Sept. 28, 2020, 5:31 p.m. OK Java 11 TESTS 44 249 12902400 1500
94166928 shiftyblock D Sept. 28, 2020, 10:52 p.m. OK Java 11 TESTS 44 249 15462400 1500
94112362 rushilpaul D Sept. 28, 2020, 10:12 a.m. OK Java 11 TESTS 42 264 12595200 1500
94138120 gladwin_rojer D Sept. 28, 2020, 2:38 p.m. OK Java 11 TESTS 44 265 8806400 1500
94166972 sushant-kun D Sept. 28, 2020, 10:55 p.m. OK Java 11 TESTS 44 265 8806400 1500
94175129 over_flow D Sept. 29, 2020, 3:54 a.m. OK Java 11 TESTS 44 265 15052800 1500
94167073 Apass.Jack D Sept. 28, 2020, 11:02 p.m. OK Java 11 TESTS 44 280 8806400 1500
94157013 Kimo_Fathy D Sept. 28, 2020, 6:38 p.m. OK Java 11 TESTS 44 280 11366400 1500
94118235 aCitizen D Sept. 28, 2020, 11:09 a.m. OK Java 11 TESTS 44 280 12390400 1500
94176102 Manan8686 D Sept. 29, 2020, 4:20 a.m. OK Java 8 TESTS 44 171 3993600 1500
94131478 prasoon006 D Sept. 28, 2020, 1:30 p.m. OK Java 8 TESTS 44 186 9625600 1500
94153314 nietzschewalrus779 D Sept. 28, 2020, 5:35 p.m. OK Java 8 TESTS 44 186 13004800 1500
94132050 sizzula D Sept. 28, 2020, 1:36 p.m. OK Java 8 TESTS 44 186 20070400 1500
94123922 tirth9960 D Sept. 28, 2020, 12:10 p.m. OK Java 8 TESTS 44 187 3584000 1500
94112602 ragnarok001 D Sept. 28, 2020, 10:14 a.m. OK Java 8 TESTS 42 187 3993600 1500
94139086 KoustavBeginner D Sept. 28, 2020, 2:48 p.m. OK Java 8 TESTS 44 187 9625600 1500
94168442 flyman3046 D Sept. 29, 2020, 12:17 a.m. OK Java 8 TESTS 44 202 14643200 1500
94157876 ranveerrandhawa2468 D Sept. 28, 2020, 6:52 p.m. OK Java 8 TESTS 44 217 11161600 1500
94127998 rahii D Sept. 28, 2020, 12:54 p.m. OK Java 8 TESTS 44 217 11264000 1500
94150391 Mirimax D Sept. 28, 2020, 4:56 p.m. OK Kotlin TESTS 44 280 22835200 1500
94114878 SlavaG D Sept. 28, 2020, 10:32 a.m. OK Kotlin TESTS 44 358 23142400 1500
94176605 emsaksham D Sept. 29, 2020, 4:30 a.m. OK MS C++ 2017 TESTS 44 140 8089600 1500
94122349 ustaritz D Sept. 28, 2020, 11:53 a.m. OK MS C++ 2017 TESTS 44 233 7782400 1500
94154162 romesfu1 D Sept. 28, 2020, 5:47 p.m. OK MS C++ 2017 TESTS 44 234 9728000 1500
94128614 transcending D Sept. 28, 2020, 1 p.m. OK MS C++ 2017 TESTS 44 249 7270400 1500
94164490 VladislavArt D Sept. 28, 2020, 9:18 p.m. OK MS C++ 2017 TESTS 44 264 9728000 1500
94147012 jonitox D Sept. 28, 2020, 4:14 p.m. OK MS C++ 2017 TESTS 44 265 6451200 1500
94144717 vladnoov D Sept. 28, 2020, 3:47 p.m. OK MS C++ 2017 TESTS 44 265 8089600 1500
94156317 DiSTRuCtO D Sept. 28, 2020, 6:25 p.m. OK MS C++ 2017 TESTS 44 265 8089600 1500
94144205 DimaArt D Sept. 28, 2020, 3:42 p.m. OK MS C++ 2017 TESTS 44 280 9728000 1500
94114887 songjunwei D Sept. 28, 2020, 10:32 a.m. OK MS C++ 2017 TESTS 44 280 10444800 1500
94114231 MyEighthName D Sept. 28, 2020, 10:26 a.m. OK .NET Core C# TESTS 44 139 33280000 1500
94169787 explorer_sifat D Sept. 29, 2020, 1:13 a.m. OK Node.js TESTS 44 358 47513600 1500
94166306 caow D Sept. 28, 2020, 10:22 p.m. OK PyPy 3 TESTS 44 233 27545600 1500
94122517 rajbit D Sept. 28, 2020, 11:55 a.m. OK PyPy 3 TESTS 44 233 27545600 1500
94114124 manikjain4 D Sept. 28, 2020, 10:25 a.m. OK PyPy 3 TESTS 44 234 25497600 1500
94135161 manhar D Sept. 28, 2020, 2:08 p.m. OK PyPy 3 TESTS 44 249 40243200 1500
94180943 dutt_shouvik D Sept. 29, 2020, 5:57 a.m. OK PyPy 3 TESTS 44 327 24166400 1500
94123083 wolpiskerter D Sept. 28, 2020, 12:01 p.m. OK PyPy 3 TESTS 44 327 25702400 1500
94118856 gourav2001k D Sept. 28, 2020, 11:16 a.m. OK PyPy 3 TESTS 44 342 24166400 1500
94118499 yikanji D Sept. 28, 2020, 11:12 a.m. OK PyPy 3 TESTS 44 342 24166400 1500
94150978 TimurABS D Sept. 28, 2020, 5:03 p.m. OK PyPy 3 TESTS 44 342 25395200 1500
94142395 trainerjono D Sept. 28, 2020, 3:22 p.m. OK PyPy 3 TESTS 44 343 24371200 1500
94121739 orazbek D Sept. 28, 2020, 11:47 a.m. OK Python 3 TESTS 44 202 19968000 1500
94133461 IngaleAnkur10 D Sept. 28, 2020, 1:50 p.m. OK Python 3 TESTS 44 218 19968000 1500
94161255 devesh1102 D Sept. 28, 2020, 7:58 p.m. OK Python 3 TESTS 44 249 20480000 1500
94178149 h20191030154 D Sept. 29, 2020, 5:03 a.m. OK Python 3 TESTS 44 249 120627200 1500
94125630 prayashverma007 D Sept. 28, 2020, 12:28 p.m. OK Python 3 TESTS 44 265 17203200 1500
94169971 wattaihei D Sept. 29, 2020, 1:20 a.m. OK Python 3 TESTS 44 265 17510400 1500
94168852 madmaxitis D Sept. 29, 2020, 12:35 a.m. OK Python 3 TESTS 44 265 19968000 1500
94177864 arvind_241999 D Sept. 29, 2020, 4:57 a.m. OK Python 3 TESTS 44 280 17510400 1500
94152853 swagsy2000 D Sept. 28, 2020, 5:29 p.m. OK Python 3 TESTS 44 280 17510400 1500
94134987 lucifer085 D Sept. 28, 2020, 2:07 p.m. OK Python 3 TESTS 44 280 19968000 1500
94115043 manta1130 D Sept. 28, 2020, 10:34 a.m. OK Rust TESTS 44 93 9625600 1500
94171010 akks800 D Sept. 29, 2020, 1:58 a.m. OK Rust TESTS 44 124 13004800 1500
94130562 tuna_salad D Sept. 28, 2020, 1:21 p.m. OK Rust TESTS 44 140 7987200 1500

remove filters

Back to search problems