Codeforces Round 640 (Div. 4)

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
1352 Codeforces Round 640 (Div. 4) FINISHED False 7200 142788299 May 9, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20734 ) E Special Elements PROGRAMMING brute force implementation two pointers 1500

B'Pay attention to the non-standard memory limit in this problem. In order to cut off efficient solutions from inefficient ones in this problem, the time limit is rather strict. Prefer to use compiled statically typed languages (e.g. C++). If you use Python, then submit solutions on PyPy. Try to write an efficient solution. The array a=[a_1, a_2, ldots, a_n] ( 1 <= a_i <= n ) is given. Its element a_i is called special if there exists a pair of indices l and r ( 1 <= l < r <= n ) such that a_i = a_l + a_{l+1} + ldots + a_r . In other words, an element is called special if it can be represented as the sum of two or more consecutive elements of an array (no matter if they are special or not). Print the number of special elements of the given array a . For example, if n=9 and a=[3,1,4,1,5,9,2,6,5] , then the answer is 5 : Please note that some of the elements of the array a may be equal -- if several elements are equal and special, then all of them should be counted in the answer. The first line contains an integer t ( 1 <= t <= 1000 ) -- the number of test cases in the input. Then t test cases follow. Each test case is given in two lines. The first line contains an integer n ( 1 <= n <= 8000 ) -- the length of the array a . The second line contains integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ). It is guaranteed that the sum of the values of n for all test cases in the input does not exceed 8000 . Print t numbers -- the number of special elements for each of the given arrays. '...

Tutorials

77161

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
80452964 Gassa E May 17, 2020, 9:06 a.m. OK D TESTS 37 46 8908800 1500
80764322 chowdhuryshashwoto E May 20, 2020, 10:48 a.m. OK GNU C11 TESTS 37 46 102400 1500
81050597 ambica E May 23, 2020, 10:15 p.m. OK GNU C11 TESTS 37 46 204800 1500
79789982 BugLeave E May 12, 2020, 12:37 a.m. OK GNU C11 TESTS 37 46 307200 1500
79903800 alexgrant E May 12, 2020, 4:44 p.m. OK GNU C11 TESTS 37 46 3686400 1500
79665007 There_there E May 10, 2020, 2:59 p.m. OK GNU C11 TESTS 37 46 3788800 1500
79715493 Amin.s E May 11, 2020, 7:28 a.m. OK GNU C11 TESTS 37 46 3788800 1500
79736042 akash456 E May 11, 2020, 12:02 p.m. OK GNU C11 TESTS 37 46 3788800 1500
79752290 _sam__ E May 11, 2020, 2 p.m. OK GNU C11 TESTS 37 46 3788800 1500
79680316 Anil888 E May 10, 2020, 6:09 p.m. OK GNU C11 TESTS 37 46 3788800 1500
79785324 daddys_angel E May 11, 2020, 9:55 p.m. OK GNU C11 TESTS 37 62 102400 1500
80762682 theSHYAM E May 20, 2020, 10:26 a.m. OK GNU C++11 TESTS 37 46 0 1500
79795216 liansheng E May 12, 2020, 3:14 a.m. OK GNU C++11 TESTS 37 46 102400 1500
81478772 gulati_harsh_ E May 26, 2020, 2:15 p.m. OK GNU C++11 TESTS 37 46 102400 1500
80960451 guitarhero22 E May 22, 2020, 6:07 p.m. OK GNU C++11 TESTS 37 46 102400 1500
80776080 Schwarzenegger E May 20, 2020, 1:23 p.m. OK GNU C++11 TESTS 37 46 102400 1500
79801258 lbttxdy E May 12, 2020, 5:31 a.m. OK GNU C++11 TESTS 37 46 102400 1500
79795806 xianzhi E May 12, 2020, 3:31 a.m. OK GNU C++11 TESTS 37 46 102400 1500
79793472 SOCAER E May 12, 2020, 2:30 a.m. OK GNU C++11 TESTS 37 46 102400 1500
79792735 luogu_bot1 E May 12, 2020, 2:07 a.m. OK GNU C++11 TESTS 37 46 102400 1500
80978189 countercurrent-time E May 23, 2020, 2:16 a.m. OK GNU C++11 TESTS 37 46 204800 1500
79749197 Ironman_3 E May 11, 2020, 1:23 p.m. OK GNU C++14 TESTS 37 31 3788800 1500
80555824 tugsuu E May 17, 2020, 9:40 p.m. OK GNU C++14 TESTS 37 31 3891200 1500
79779349 Khaled_Mohamed E May 11, 2020, 7:51 p.m. OK GNU C++14 TESTS 37 46 0 1500
80726810 azazel_joker E May 19, 2020, 9:07 p.m. OK GNU C++14 TESTS 37 46 0 1500
79785696 Ahmed_Almohammed E May 11, 2020, 10:06 p.m. OK GNU C++14 TESTS 37 46 0 1500
80620902 HenryH E May 18, 2020, 4:09 p.m. OK GNU C++14 TESTS 37 46 0 1500
81596286 best_me E May 27, 2020, 8:13 a.m. OK GNU C++14 TESTS 37 46 102400 1500
81334594 _Kaitouz_ E May 24, 2020, 10 p.m. OK GNU C++14 TESTS 37 46 102400 1500
81348664 shabbirmur E May 25, 2020, 5:13 a.m. OK GNU C++14 TESTS 37 46 102400 1500
81407138 SebasV8 E May 25, 2020, 5:32 p.m. OK GNU C++14 TESTS 37 46 102400 1500
80203634 Abhishek_Kumar E May 15, 2020, 8:09 a.m. OK GNU C++17 TESTS 37 31 3788800 1500
79735077 StEpAn_123 E May 11, 2020, 11:51 a.m. OK GNU C++17 TESTS 37 31 3891200 1500
80773751 ankitkk31 E May 20, 2020, 12:51 p.m. OK GNU C++17 TESTS 37 46 0 1500
80664848 Cyber_Wizard E May 19, 2020, 7:35 a.m. OK GNU C++17 TESTS 37 46 0 1500
80686236 nj_force E May 19, 2020, 12:20 p.m. OK GNU C++17 TESTS 37 46 0 1500
80969586 Dilemma27 E May 22, 2020, 8:49 p.m. OK GNU C++17 TESTS 37 46 102400 1500
81683715 XXXXNXX E May 28, 2020, 8:05 a.m. OK GNU C++17 TESTS 37 46 102400 1500
81164774 bshr963 E May 24, 2020, 10:06 a.m. OK GNU C++17 TESTS 37 46 102400 1500
81162449 HinS E May 24, 2020, 9:35 a.m. OK GNU C++17 TESTS 37 46 102400 1500
81471149 Domeanor E May 26, 2020, 12:44 p.m. OK GNU C++17 TESTS 37 46 102400 1500
79676839 hardiksh0512 E May 10, 2020, 5:24 p.m. OK GNU C++17 (64) TESTS 37 31 4403200 1500
79703107 SouravSharma E May 11, 2020, 3:28 a.m. OK GNU C++17 (64) TESTS 37 31 4505600 1500
80963956 The_Anthony E May 22, 2020, 7 p.m. OK GNU C++17 (64) TESTS 37 46 0 1500
80806890 nchee E May 20, 2020, 8:55 p.m. OK GNU C++17 (64) TESTS 37 46 102400 1500
81670034 Micc E May 28, 2020, 4:52 a.m. OK GNU C++17 (64) TESTS 37 46 102400 1500
81636037 Stiff_Subset E May 27, 2020, 3:52 p.m. OK GNU C++17 (64) TESTS 37 46 102400 1500
81055743 davidSC E May 24, 2020, 2:18 a.m. OK GNU C++17 (64) TESTS 37 46 102400 1500
80922975 vjudge4 E May 22, 2020, 10:07 a.m. OK GNU C++17 (64) TESTS 37 46 102400 1500
80910801 vjudge1 E May 22, 2020, 7:21 a.m. OK GNU C++17 (64) TESTS 37 46 102400 1500
80763606 fish2 E May 20, 2020, 10:38 a.m. OK GNU C++17 (64) TESTS 37 46 102400 1500
79917603 muravjov E May 12, 2020, 7:20 p.m. OK Go TESTS 37 873 10752000 1500
79803447 Holaf E May 12, 2020, 9:08 a.m. OK Java 11 TESTS 37 202 23552000 1500
79806009 Holaf E May 12, 2020, 10:10 a.m. OK Java 11 TESTS 37 217 23552000 1500
80196053 edwardsangam E May 15, 2020, 6:19 a.m. OK Java 11 TESTS 37 233 23449600 1500
79804777 chiragkaushik1 E May 12, 2020, 9:41 a.m. OK Java 11 TESTS 37 233 23756800 1500
81463957 zhupeijun E May 26, 2020, 11:21 a.m. OK Java 11 TESTS 37 234 0 1500
80419039 -Tommy- E May 16, 2020, 10:31 p.m. OK Java 11 TESTS 37 234 23449600 1500
81402881 ap_143 E May 25, 2020, 4:36 p.m. OK Java 11 TESTS 37 249 0 1500
80933709 egaeus.code E May 22, 2020, 12:31 p.m. OK Java 11 TESTS 37 249 0 1500
80169904 sunnyguan E May 14, 2020, 7:26 p.m. OK Java 11 TESTS 37 249 23449600 1500
79676881 Nisiddharth E May 10, 2020, 5:24 p.m. OK Java 11 TESTS 37 249 23449600 1500
80973761 Oopsimbad E May 22, 2020, 10:57 p.m. OK Java 8 TESTS 37 109 3481600 1500
80198086 bluesky111 E May 15, 2020, 6:48 a.m. OK Java 8 TESTS 37 109 25907200 1500
81015167 ontheqt E May 23, 2020, 12:43 p.m. OK Java 8 TESTS 37 124 3686400 1500
80297461 Kavi.Prajapati E May 16, 2020, 9:02 a.m. OK Java 8 TESTS 37 124 26112000 1500
79990601 thedagger E May 13, 2020, 2:39 p.m. OK Java 8 TESTS 37 124 26112000 1500
79673738 di_halt E May 10, 2020, 4:43 p.m. OK Java 8 TESTS 37 124 26112000 1500
79949022 godxpunk E May 13, 2020, 6:31 a.m. OK Java 8 TESTS 37 139 26009600 1500
79689431 ineffablekenobi E May 10, 2020, 8:31 p.m. OK Java 8 TESTS 37 139 26009600 1500
79673794 di_halt E May 10, 2020, 4:43 p.m. OK Java 8 TESTS 37 139 26112000 1500
81144365 arnav_mandal E May 24, 2020, 7:51 a.m. OK Java 8 TESTS 37 140 3584000 1500
79713562 notAProgrammer_NAP E May 11, 2020, 7:03 a.m. OK JavaScript TESTS 37 748 8499200 1500
79909387 aandrrei E May 12, 2020, 5:38 p.m. OK Kotlin TESTS 37 187 27340800 1500
80191994 tabr E May 15, 2020, 5:03 a.m. OK Kotlin TESTS 37 202 27340800 1500
80810206 jmrh_1 E May 20, 2020, 10:53 p.m. OK Kotlin TESTS 37 296 5836800 1500
80233648 Killer45 E May 15, 2020, 2:14 p.m. OK Kotlin TESTS 37 358 26112000 1500
80275172 sakapon E May 16, 2020, 3:41 a.m. OK Mono C# TESTS 37 77 12595200 1500
80061347 AsadulloProgrammist E May 14, 2020, 11:04 a.m. OK Mono C# TESTS 37 78 8908800 1500
79883150 Nottyy E May 12, 2020, 2:41 p.m. OK Mono C# TESTS 37 78 12595200 1500
80274077 sakapon E May 16, 2020, 3:13 a.m. OK Mono C# TESTS 37 93 15052800 1500
79970458 anish.1922 E May 13, 2020, 10:51 a.m. OK Mono C# TESTS 37 108 12595200 1500
80614273 tjktnrVK E May 18, 2020, 3 p.m. OK Mono C# TESTS 37 701 13209600 1500
80673544 Hokage. E May 19, 2020, 9:35 a.m. OK MS C++ TESTS 37 46 102400 1500
79667833 GekkoHayate E May 10, 2020, 3:30 p.m. OK MS C++ TESTS 37 46 3891200 1500
79735811 vjudge1 E May 11, 2020, 11:59 a.m. OK MS C++ TESTS 37 61 3993600 1500
80066042 JasminI E May 14, 2020, 11:58 a.m. OK MS C++ TESTS 37 61 4198400 1500
79804565 vjudge2 E May 12, 2020, 9:37 a.m. OK MS C++ TESTS 37 62 3993600 1500
80925162 un_dauant E May 22, 2020, 10:41 a.m. OK MS C++ TESTS 37 109 409600 1500
79781366 YTICpoch E May 11, 2020, 8:27 p.m. OK MS C++ TESTS 37 514 307200 1500
80168929 Nick_after_concont E May 14, 2020, 7:10 p.m. OK MS C++ 2017 TESTS 37 46 3788800 1500
80577614 ayuhero31 E May 18, 2020, 7:06 a.m. OK MS C++ 2017 TESTS 37 46 3788800 1500
80272612 tax E May 16, 2020, 2:31 a.m. OK MS C++ 2017 TESTS 37 46 3788800 1500
79755253 ningBr E May 11, 2020, 2:33 p.m. OK MS C++ 2017 TESTS 37 46 3891200 1500
80538243 Chelseahazard E May 17, 2020, 4:26 p.m. OK MS C++ 2017 TESTS 37 46 3891200 1500
81170804 Amuses E May 24, 2020, 11:29 a.m. OK MS C++ 2017 TESTS 37 61 102400 1500
79719314 AliiHME E May 11, 2020, 8:27 a.m. OK MS C++ 2017 TESTS 37 61 3788800 1500
79730221 metal4people E May 11, 2020, 10:54 a.m. OK MS C++ 2017 TESTS 37 61 3788800 1500
79700484 skymin E May 11, 2020, 2:16 a.m. OK MS C++ 2017 TESTS 37 62 3788800 1500
80059721 kapil16garg E May 14, 2020, 10:45 a.m. OK MS C++ 2017 TESTS 37 62 3788800 1500
81052759 vbrigand E May 23, 2020, 11:49 p.m. OK Node.js TESTS 37 452 1740800 1500
79726934 mishagam E May 11, 2020, 10:12 a.m. OK Ocaml TESTS 37 77 3993600 1500
80756252 sesnf E May 20, 2020, 8:58 a.m. OK PyPy 2 TESTS 37 265 1331200 1500
79938118 flyman3046 E May 13, 2020, 3:36 a.m. OK PyPy 2 TESTS 37 451 30003200 1500
79921133 timf1089 E May 12, 2020, 8:15 p.m. OK PyPy 2 TESTS 37 498 26316800 1500
79722545 sksshivam007 E May 11, 2020, 9:14 a.m. OK PyPy 2 TESTS 37 576 25190400 1500
80781746 sanjay-leo E May 20, 2020, 2:37 p.m. OK PyPy 3 TESTS 37 218 3379200 1500
80543253 apoorvwatsky E May 17, 2020, 5:37 p.m. OK PyPy 3 TESTS 37 218 24064000 1500
79679307 CaHutar E May 10, 2020, 5:55 p.m. OK PyPy 3 TESTS 37 233 28672000 1500
79693507 blinovsv E May 10, 2020, 10:09 p.m. OK PyPy 3 TESTS 37 248 23244800 1500
79672455 Lariyol E May 10, 2020, 4:26 p.m. OK PyPy 3 TESTS 37 248 24985600 1500
79693445 blinovsv E May 10, 2020, 10:07 p.m. OK PyPy 3 TESTS 37 249 23347200 1500
79693062 blinovsv E May 10, 2020, 9:55 p.m. OK PyPy 3 TESTS 37 249 23449600 1500
79693605 blinovsv E May 10, 2020, 10:12 p.m. OK PyPy 3 TESTS 37 249 24985600 1500
79672986 ShahJahan19 E May 10, 2020, 4:33 p.m. OK PyPy 3 TESTS 37 249 24985600 1500
79681121 LintuStorm E May 10, 2020, 6:21 p.m. OK PyPy 3 TESTS 37 249 25292800 1500
79662003 kushwaha_vi E May 10, 2020, 2:26 p.m. OK Scala TESTS 37 654 44441600 1500

remove filters

Back to search problems