Educational Codeforces Round 115 (Rated for 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
1598 Educational Codeforces Round 115 (Rated for Div. 2) FINISHED False 7200 103323263 Oct. 10, 2021, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 21440 ) C Delete Two Elements PROGRAMMING data structures math

B"Monocarp has got an array a consisting of n integers. Let's denote k as the mathematic mean of these elements (note that it's possible that k is not an integer). The mathematic mean of an array of n elements is the sum of elements divided by the number of these elements (i. xe2 x80 x89e. sum divided by n ). Monocarp wants to delete exactly two elements from a so that the mathematic mean of the remaining (n - 2) elements is still equal to k . Your task is to calculate the number of pairs of positions [i, j] ( i < j ) such that if the elements on these positions are deleted, the mathematic mean of (n - 2) remaining elements is equal to k (that is, it is equal to the mathematic mean of n elements of the original array a ). The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of testcases. The first line of each testcase contains one integer n ( 3 <= n <= 2 cdot 10^5 ) -- the number of elements in the array. The second line contains a sequence of integers a_1, a_2, ... , a_n ( 0 <= a_i <= 10^{9} ), where a_i is the i -th element of the array. The sum of n over all testcases doesn't exceed 2 cdot 10^5 . Print one integer -- the number of pairs of positions [i, j] ( i < j ) such that if the elements on these positions are deleted, the mathematic mean of (n - 2) remaining elements is equal to k (that is, it is equal to the mathematic mean of n elements of the original array a ). In the first example, any pair of elements can be removed since all of them are equal. In the second example, there is no way to delete two elements so the mathematic mean doesn't change. In the third example, it is possible to delete the elements on positions 1 and 3 , or the elements on positions 4 and 5 . "...

Tutorials

95890

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
131460531 I_love_Yuuki_Asuna C Oct. 10, 2021, 12:04 p.m. OK FPC TESTS 121 108 4198400
131490549 rainboy C Oct. 10, 2021, 5:58 p.m. OK GNU C11 TESTS 121 108 5324800
131488100 lelouch-of-the-code C Oct. 10, 2021, 5:22 p.m. OK GNU C11 TESTS 121 109 6860800
131458938 yycyyc C Oct. 10, 2021, 11:48 a.m. OK GNU C++14 TESTS 121 77 5324800
131462073 yutabi C Oct. 10, 2021, 12:21 p.m. OK GNU C++14 TESTS 121 78 5324800
131452656 phanvythien123 C Oct. 10, 2021, 11:03 a.m. OK GNU C++14 TESTS 121 93 4505600
131452340 q0000000 C Oct. 10, 2021, 11:02 a.m. OK GNU C++14 TESTS 121 93 4505600
131508082 WHC_MIK_7521X C Oct. 11, 2021, 2:41 a.m. OK GNU C++14 TESTS 121 93 4505600
131512913 avdp C Oct. 11, 2021, 4:19 a.m. OK GNU C++14 TESTS 121 93 5324800
131508876 ZeroBlast C Oct. 11, 2021, 2:59 a.m. OK GNU C++14 TESTS 121 93 5324800
131508561 ZeroBlast C Oct. 11, 2021, 2:52 a.m. OK GNU C++14 TESTS 121 93 5324800
131450733 dcoded C Oct. 10, 2021, 10:58 a.m. OK GNU C++14 TESTS 121 93 5324800
131512978 avdp C Oct. 11, 2021, 4:20 a.m. OK GNU C++14 TESTS 121 93 5324800
131509003 sky123 C Oct. 11, 2021, 3:02 a.m. OK GNU C++17 TESTS 121 78 37580800
131497040 LoNgLoNgDoUblE C Oct. 10, 2021, 7:44 p.m. OK GNU C++17 TESTS 121 93 4505600
131494579 Dmitry-Kuznetsov C Oct. 10, 2021, 7:01 p.m. OK GNU C++17 TESTS 121 93 4505600
131463130 1205691775 C Oct. 10, 2021, 12:32 p.m. OK GNU C++17 TESTS 121 93 4505600
131461082 heisenberg09 C Oct. 10, 2021, 12:11 p.m. OK GNU C++17 TESTS 121 93 4505600
131506883 panyaoyu1999 C Oct. 11, 2021, 1:58 a.m. OK GNU C++17 TESTS 121 93 4505600
131501940 thanhchauns2 C Oct. 10, 2021, 9:47 p.m. OK GNU C++17 TESTS 121 93 5324800
131498565 DragonO_o C Oct. 10, 2021, 8:16 p.m. OK GNU C++17 TESTS 121 93 5324800
131476052 wnmrmr C Oct. 10, 2021, 2:52 p.m. OK GNU C++17 TESTS 121 93 5324800
131515395 titan_shiv C Oct. 11, 2021, 5:05 a.m. OK GNU C++17 TESTS 121 93 5324800
131492988 old_school_Reborn C Oct. 10, 2021, 6:36 p.m. OK GNU C++17 (64) TESTS 121 62 5939200
131491923 tantra11 C Oct. 10, 2021, 6:19 p.m. OK GNU C++17 (64) TESTS 121 77 5120000
131507752 Bhattji C Oct. 11, 2021, 2:32 a.m. OK GNU C++17 (64) TESTS 121 77 5939200
131479983 Lets_go C Oct. 10, 2021, 3:38 p.m. OK GNU C++17 (64) TESTS 121 77 5939200
131467010 jinhan814 C Oct. 10, 2021, 1:15 p.m. OK GNU C++17 (64) TESTS 121 77 5939200
131507965 nlog C Oct. 11, 2021, 2:39 a.m. OK GNU C++17 (64) TESTS 121 77 5939200
131454617 MFYT20 C Oct. 10, 2021, 11:13 a.m. OK GNU C++17 (64) TESTS 121 77 5939200
131452525 Rishi24 C Oct. 10, 2021, 11:03 a.m. OK GNU C++17 (64) TESTS 121 77 5939200
131451143 xhdtlsid2 C Oct. 10, 2021, 10:59 a.m. OK GNU C++17 (64) TESTS 121 77 5939200
131463868 sudip777sharma C Oct. 10, 2021, 12:41 p.m. OK GNU C++17 (64) TESTS 121 77 5939200
131514287 vtiptop C Oct. 11, 2021, 4:46 a.m. OK Go TESTS 121 234 23449600
131508603 nor C Oct. 11, 2021, 2:53 a.m. OK Go TESTS 121 264 23449600
131456873 kartheek542 C Oct. 10, 2021, 11:29 a.m. OK Java 11 TESTS 121 264 23859200
131459053 kartheek542 C Oct. 10, 2021, 11:49 a.m. OK Java 11 TESTS 121 280 23859200
131451264 kingsmo13 C Oct. 10, 2021, 10:59 a.m. OK Java 11 TESTS 121 312 24780800
131497183 solo07 C Oct. 10, 2021, 7:47 p.m. OK Java 11 TESTS 121 327 38502400
131495843 ashanksingh1997 C Oct. 10, 2021, 7:23 p.m. OK Java 11 TESTS 121 342 37580800
131494364 dominicoooo C Oct. 10, 2021, 6:57 p.m. OK Java 11 TESTS 121 358 35942400
131452077 ssd_301 C Oct. 10, 2021, 11:02 a.m. OK Java 11 TESTS 121 358 37990400
131505153 7amasa C Oct. 11, 2021, 12:08 a.m. OK Java 11 TESTS 121 358 37990400
131458407 Tyson761 C Oct. 10, 2021, 11:42 a.m. OK Java 11 TESTS 121 358 38604800
131455544 ak6494285 C Oct. 10, 2021, 11:19 a.m. OK Java 11 TESTS 121 358 70963200
131454364 ygonepiece C Oct. 10, 2021, 11:12 a.m. OK Java 8 TESTS 121 249 26931200
131478793 themadknight45 C Oct. 10, 2021, 3:23 p.m. OK Java 8 TESTS 121 249 27648000
131454703 ygonepiece C Oct. 10, 2021, 11:14 a.m. OK Java 8 TESTS 121 280 26828800
131486129 BruteForcee C Oct. 10, 2021, 4:56 p.m. OK Java 8 TESTS 121 296 27238400
131481195 gawsfbet C Oct. 10, 2021, 3:53 p.m. OK Java 8 TESTS 121 296 39116800
131478576 pras7946 C Oct. 10, 2021, 3:21 p.m. OK Java 8 TESTS 121 296 40755200
131455901 omar_mohammed C Oct. 10, 2021, 11:22 a.m. OK Java 8 TESTS 121 311 27443200
131466142 aashay_03 C Oct. 10, 2021, 1:06 p.m. OK Java 8 TESTS 121 311 37273600
131464629 aashay_03 C Oct. 10, 2021, 12:49 p.m. OK Java 8 TESTS 121 312 37171200
131498237 kkkkush C Oct. 10, 2021, 8:09 p.m. OK Java 8 TESTS 121 327 41164800
131511252 DATVN C Oct. 11, 2021, 3:49 a.m. OK Kotlin 1.5 TESTS 121 701 45568000
131457056 Agumon C Oct. 10, 2021, 11:31 a.m. OK MS C++ 2017 TESTS 121 109 7782400
131479772 Xeniya C Oct. 10, 2021, 3:35 p.m. OK MS C++ 2017 TESTS 121 249 5324800
131487700 UnHingedFrog C Oct. 10, 2021, 5:17 p.m. OK MS C++ 2017 TESTS 121 374 13926400
131461097 codmacian C Oct. 10, 2021, 12:11 p.m. OK MS C++ 2017 TESTS 121 390 22425600
131485434 dino_merlin C Oct. 10, 2021, 4:46 p.m. OK MS C++ 2017 TESTS 121 421 21401600
131454652 Vetriti C Oct. 10, 2021, 11:13 a.m. OK MS C++ 2017 TESTS 121 451 13414400
131481430 forcy_guy C Oct. 10, 2021, 3:56 p.m. OK MS C++ 2017 TESTS 121 467 21401600
131465845 Tangerine C Oct. 10, 2021, 1:02 p.m. OK MS C++ 2017 TESTS 121 748 21401600
131456896 90-stick C Oct. 10, 2021, 11:29 a.m. OK .NET Core C# TESTS 121 171 42598400
131452474 fmota C Oct. 10, 2021, 11:03 a.m. OK PyPy 2 TESTS 121 358 41062400
131478812 ShashankZobb C Oct. 10, 2021, 3:24 p.m. OK PyPy 2 TESTS 121 374 53043200
131517902 mbansal063 C Oct. 11, 2021, 5:44 a.m. OK PyPy 2 TESTS 121 436 53452800
131475116 derghost C Oct. 10, 2021, 2:42 p.m. OK PyPy 3 TESTS 121 202 41164800
131500158 ossau_guildo C Oct. 10, 2021, 8:53 p.m. OK PyPy 3 TESTS 121 234 43724800
131454813 nitish420 C Oct. 10, 2021, 11:14 a.m. OK PyPy 3 TESTS 121 280 44544000
131517679 viraldoshi C Oct. 11, 2021, 5:41 a.m. OK PyPy 3 TESTS 121 311 42188800
131475246 not_tehlka C Oct. 10, 2021, 2:43 p.m. OK PyPy 3 TESTS 121 311 48332800
131512594 Nemisis2.O C Oct. 11, 2021, 4:13 a.m. OK PyPy 3 TESTS 121 312 55398400
131505500 YMSeah C Oct. 11, 2021, 12:23 a.m. OK PyPy 3 TESTS 121 327 47411200
131470348 hxu10 C Oct. 10, 2021, 1:50 p.m. OK PyPy 3 TESTS 121 327 51200000
131454368 vaibhav_india C Oct. 10, 2021, 11:12 a.m. OK PyPy 3 TESTS 121 342 48230400
131461919 IkshitG C Oct. 10, 2021, 12:19 p.m. OK PyPy 3 TESTS 121 358 34508800
131452665 prajal_patidar C Oct. 10, 2021, 11:03 a.m. OK Python 3 TESTS 121 280 23142400
131472224 Land_oF_cOdErS C Oct. 10, 2021, 2:10 p.m. OK Python 3 TESTS 121 280 23347200
131452305 i_aman C Oct. 10, 2021, 11:02 a.m. OK Python 3 TESTS 121 280 24473600
131477162 abhijeet.panihar.cse20 C Oct. 10, 2021, 3:04 p.m. OK Python 3 TESTS 121 296 23449600
131451495 abcsumit C Oct. 10, 2021, 11 a.m. OK Python 3 TESTS 121 311 23552000
131518836 orazbek C Oct. 11, 2021, 5:57 a.m. OK Python 3 TESTS 121 311 23654400
131460393 eugalt C Oct. 10, 2021, 12:03 p.m. OK Python 3 TESTS 121 312 25190400
131474010 vtiptop C Oct. 10, 2021, 2:30 p.m. OK Python 3 TESTS 121 312 34406400
131516024 Arsen4ikVar C Oct. 11, 2021, 5:15 a.m. OK Python 3 TESTS 121 312 35635200
131517751 viraldoshi C Oct. 11, 2021, 5:42 a.m. OK Python 3 TESTS 121 327 22630400
131464505 sansen C Oct. 10, 2021, 12:48 p.m. OK Rust TESTS 121 108 13107200
131461205 Spheniscine C Oct. 10, 2021, 12:12 p.m. OK Rust TESTS 121 124 12185600

remove filters

Back to search problems