Good Bye 2021: 2022 is NEAR

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
1616 Good Bye 2021: 2022 is NEAR FINISHED False 7200 96474263 Dec. 29, 2021, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12426 ) C Representative Edges PROGRAMMING brute force geometry implementation math 1500

B'An array a_1, a_2, ldots, a_n is good if and only if for every subsegment 1 <= q l <= q r <= q n , the following holds: a_l + a_{l + 1} + ldots + a_r = frac{1}{2}(a_l + a_r) cdot (r - l + 1) . You are given an array of integers a_1, a_2, ldots, a_n . In one operation, you can replace any one element of this array with any real number. Find the minimum number of operations you need to make this array good. The first line of input contains one integer t ( 1 <= q t <= q 100 ): the number of test cases. Each of the next t lines contains the description of a test case. In the first line you are given one integer n ( 1 <= q n <= q 70 ): the number of integers in the array. The second line contains n integers a_1, a_2, ldots, a_n ( -100 <= q a_i <= q 100 ): the initial array. For each test case, print one integer: the minimum number of elements that you need to replace to make the given array good. In the first test case, the array is good already. In the second test case, one of the possible good arrays is [1, 1, underline{1}, underline{1}] (replaced elements are underlined). In the third test case, the array is good already. In the fourth test case, one of the possible good arrays is [ underline{-2.5}, -2, underline{-1.5}, -1, underline{-0.5}, 0] . '...

Tutorials

Good Bye 2021 -- Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
141159314 H_a_c_kcode_gaurav C Dec. 30, 2021, 12:27 p.m. OK GNU C11 TESTS 7 15 0 1500
141202782 saker.hajji C Dec. 30, 2021, 11:14 p.m. OK GNU C11 TESTS 7 15 0 1500
141166533 rainboy C Dec. 30, 2021, 1:44 p.m. OK GNU C11 TESTS 7 30 0 1500
141177425 Emjl C Dec. 30, 2021, 3:46 p.m. OK GNU C++14 TESTS 7 0 0 1500
141206863 XueYJ C Dec. 31, 2021, 2:12 a.m. OK GNU C++14 TESTS 7 0 0 1500
141199703 anirvinv C Dec. 30, 2021, 9:17 p.m. OK GNU C++14 TESTS 7 0 102400 1500
141202662 269416643 C Dec. 30, 2021, 11:10 p.m. OK GNU C++14 TESTS 7 15 0 1500
141188422 ayushkedia0511 C Dec. 30, 2021, 6 p.m. OK GNU C++14 TESTS 7 15 0 1500
141154505 Author1ty C Dec. 30, 2021, 11:35 a.m. OK GNU C++14 TESTS 7 15 0 1500
141147760 hefengchen C Dec. 30, 2021, 10:28 a.m. OK GNU C++14 TESTS 7 15 0 1500
141145166 DKingluvQAnh C Dec. 30, 2021, 9:58 a.m. OK GNU C++14 TESTS 7 15 0 1500
141133399 erdosnumber C Dec. 29, 2021, 6:35 p.m. OK GNU C++14 TESTS 7 15 0 1500
141205583 fytftyf C Dec. 31, 2021, 1:21 a.m. OK GNU C++14 TESTS 7 15 0 1500
141130310 firizky C Dec. 29, 2021, 6:10 p.m. OK GNU C++17 TESTS 5 0 0 1500
141147357 gagan_sharma C Dec. 30, 2021, 10:24 a.m. OK GNU C++17 TESTS 7 0 102400 1500
141201757 LipArcanjo C Dec. 30, 2021, 10:30 p.m. OK GNU C++17 TESTS 7 0 204800 1500
141198516 EdvardsF C Dec. 30, 2021, 8:45 p.m. OK GNU C++17 TESTS 7 15 0 1500
141196393 vudeshmukh C Dec. 30, 2021, 8:01 p.m. OK GNU C++17 TESTS 7 15 0 1500
141212003 Buiha177 C Dec. 31, 2021, 4:45 a.m. OK GNU C++17 TESTS 7 15 0 1500
141194803 sumitprajapati C Dec. 30, 2021, 7:31 p.m. OK GNU C++17 TESTS 7 15 0 1500
141196123 the_compiler C Dec. 30, 2021, 7:56 p.m. OK GNU C++17 TESTS 7 15 0 1500
141209881 LarryNY C Dec. 31, 2021, 3:52 a.m. OK GNU C++17 TESTS 7 15 0 1500
141203261 HIU_Saury C Dec. 30, 2021, 11:36 p.m. OK GNU C++17 TESTS 7 15 0 1500
141165268 Saimun_Islam C Dec. 30, 2021, 1:31 p.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141213121 dumb_coder323 C Dec. 31, 2021, 5:08 a.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141202338 ddvddv C Dec. 30, 2021, 10:56 p.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141178205 wasfia-_- C Dec. 30, 2021, 3:56 p.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141166574 schwarzchild C Dec. 30, 2021, 1:45 p.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141162991 placik C Dec. 30, 2021, 1:08 p.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141161537 TimeWarp101 C Dec. 30, 2021, 12:51 p.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141154323 Codurr C Dec. 30, 2021, 11:33 a.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141150193 Codurr C Dec. 30, 2021, 10:54 a.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141149042 saurabhkulkarni C Dec. 30, 2021, 10:42 a.m. OK GNU C++17 (64) TESTS 7 15 0 1500
141148779 KingRayuga C Dec. 30, 2021, 10:40 a.m. OK GNU C++20 (64) TESTS 7 0 0 1500
141205460 noname___ C Dec. 31, 2021, 1:16 a.m. OK GNU C++20 (64) TESTS 7 15 0 1500
141199570 amirhozaifa C Dec. 30, 2021, 9:12 p.m. OK GNU C++20 (64) TESTS 7 15 0 1500
141199139 Bhatiya C Dec. 30, 2021, 9:01 p.m. OK GNU C++20 (64) TESTS 7 15 0 1500
141196789 arnav2004 C Dec. 30, 2021, 8:08 p.m. OK GNU C++20 (64) TESTS 7 15 0 1500
141196695 arnav2004 C Dec. 30, 2021, 8:06 p.m. OK GNU C++20 (64) TESTS 7 15 0 1500
141195822 qwerty123454321 C Dec. 30, 2021, 7:50 p.m. OK GNU C++20 (64) TESTS 7 15 0 1500
141213622 jojonicho C Dec. 31, 2021, 5:19 a.m. OK GNU C++20 (64) TESTS 7 15 0 1500
141213989 Rockroyal C Dec. 31, 2021, 5:25 a.m. OK GNU C++20 (64) TESTS 7 15 0 1500
141212305 not_alone C Dec. 31, 2021, 4:51 a.m. OK GNU C++20 (64) TESTS 7 15 0 1500
141172283 tovenja C Dec. 30, 2021, 2:45 p.m. OK Go TESTS 7 46 5017600 1500
141208360 RISHI_RAJ_SINGH C Dec. 31, 2021, 3:03 a.m. OK Java 11 TESTS 7 186 0 1500
141189157 MrOtter C Dec. 30, 2021, 6:09 p.m. OK Java 11 TESTS 7 186 0 1500
141170075 _ryan18_ C Dec. 30, 2021, 2:20 p.m. OK Java 11 TESTS 7 186 0 1500
141149417 mareshkau C Dec. 30, 2021, 10:46 a.m. OK Java 11 TESTS 7 186 0 1500
141133145 NO__OB C Dec. 29, 2021, 6:32 p.m. OK Java 11 TESTS 6 187 0 1500
141146903 dhruvil_8803 C Dec. 30, 2021, 10:19 a.m. OK Java 11 TESTS 7 202 0 1500
141192890 _TrevorPhillips_ C Dec. 30, 2021, 7 p.m. OK Java 11 TESTS 7 202 0 1500
141191222 Abhinavrajhans C Dec. 30, 2021, 6:36 p.m. OK Java 11 TESTS 7 202 0 1500
141185814 LongWalk C Dec. 30, 2021, 5:28 p.m. OK Java 11 TESTS 7 202 0 1500
141135649 v0s7er C Dec. 29, 2021, 6:59 p.m. OK Java 11 TESTS 7 202 0 1500
141165697 DEMO23 C Dec. 30, 2021, 1:36 p.m. OK Java 8 TESTS 7 93 0 1500
141150994 gssakash C Dec. 30, 2021, 11:03 a.m. OK Java 8 TESTS 7 93 0 1500
141155993 ln_nl C Dec. 30, 2021, 11:51 a.m. OK Java 8 TESTS 7 108 0 1500
141148045 Push_back7 C Dec. 30, 2021, 10:32 a.m. OK Java 8 TESTS 7 124 0 1500
141132192 stevie1024 C Dec. 29, 2021, 6:24 p.m. OK Java 8 TESTS 5 124 0 1500
141131145 Omar_Mohammad C Dec. 29, 2021, 6:16 p.m. OK Java 8 TESTS 5 124 0 1500
141196426 pranayrana14 C Dec. 30, 2021, 8:02 p.m. OK Java 8 TESTS 7 139 0 1500
141191711 guru1603 C Dec. 30, 2021, 6:43 p.m. OK Java 8 TESTS 7 139 0 1500
141166433 SuvajitGhosh C Dec. 30, 2021, 1:43 p.m. OK Java 8 TESTS 7 139 0 1500
141144176 harshsingla06 C Dec. 30, 2021, 9:46 a.m. OK Java 8 TESTS 7 139 0 1500
141194151 _Astron C Dec. 30, 2021, 7:20 p.m. OK Kotlin 1.4 TESTS 7 124 0 1500
141175603 abdelrahman_rashed C Dec. 30, 2021, 3:23 p.m. OK MS C++ 2017 TESTS 7 15 0 1500
141152622 A_Pier C Dec. 30, 2021, 11:18 a.m. OK MS C++ 2017 TESTS 7 31 0 1500
141152666 A_Pier C Dec. 30, 2021, 11:18 a.m. OK MS C++ 2017 TESTS 7 46 0 1500
141152490 A_Pier C Dec. 30, 2021, 11:17 a.m. OK MS C++ 2017 TESTS 7 46 0 1500
141164189 Tagaki C Dec. 30, 2021, 1:20 p.m. OK MS C++ 2017 TESTS 7 78 0 1500
141133573 andreyDagger C Dec. 29, 2021, 6:37 p.m. OK MS C++ 2017 TESTS 7 93 204800 1500
141212904 vjudge2 C Dec. 31, 2021, 5:04 a.m. OK MS C++ 2017 TESTS 7 607 3993600 1500
141213019 Agumon C Dec. 31, 2021, 5:06 a.m. OK MS C++ 2017 TESTS 7 624 3993600 1500
141131082 OLOGY C Dec. 29, 2021, 6:15 p.m. OK PyPy 2 TESTS 5 499 3686400 1500
141131399 OLOGY C Dec. 29, 2021, 6:18 p.m. OK PyPy 2 TESTS 5 530 4300800 1500
141131727 OLOGY C Dec. 29, 2021, 6:20 p.m. OK PyPy 2 TESTS 5 561 4403200 1500
141130254 legend.ary_as C Dec. 29, 2021, 6:09 p.m. OK PyPy 3 TESTS 5 124 2764800 1500
141131223 prime.1729 C Dec. 29, 2021, 6:16 p.m. OK PyPy 3 TESTS 5 170 3174400 1500
141193782 mrinal2233 C Dec. 30, 2021, 7:13 p.m. OK PyPy 3 TESTS 7 171 3174400 1500
141141323 VioletVal C Dec. 30, 2021, 9:10 a.m. OK PyPy 3 TESTS 7 186 2355200 1500
141204151 ice11667 C Dec. 31, 2021, 12:18 a.m. OK PyPy 3 TESTS 7 186 2867200 1500
141206948 NIU_MA C Dec. 31, 2021, 2:15 a.m. OK PyPy 3 TESTS 7 187 2150400 1500
141171277 guswnd C Dec. 30, 2021, 2:32 p.m. OK PyPy 3 TESTS 7 187 2764800 1500
141155009 KeiTsukishima C Dec. 30, 2021, 11:41 a.m. OK PyPy 3 TESTS 7 202 4812800 1500
141183398 NotGil C Dec. 30, 2021, 4:59 p.m. OK PyPy 3 TESTS 7 217 2048000 1500
141198729 JaneKri C Dec. 30, 2021, 8:51 p.m. OK PyPy 3 TESTS 7 234 3072000 1500
141135860 AbnerShen C Dec. 29, 2021, 7:02 p.m. OK PyPy 3-64 TESTS 7 217 9216000 1500
141182774 fan_of_tourist C Dec. 30, 2021, 4:51 p.m. OK PyPy 3-64 TESTS 7 233 5939200 1500
141170141 dragon_reborn C Dec. 30, 2021, 2:20 p.m. OK PyPy 3-64 TESTS 7 264 5939200 1500
141182666 hr4_harsh C Dec. 30, 2021, 4:50 p.m. OK PyPy 3-64 TESTS 7 265 3072000 1500
141130240 ai4youej C Dec. 29, 2021, 6:09 p.m. OK PyPy 3-64 TESTS 5 280 4915200 1500
141178264 skydog C Dec. 30, 2021, 3:56 p.m. OK PyPy 3-64 TESTS 7 311 2764800 1500
141158445 sharmashubham1292000 C Dec. 30, 2021, 12:18 p.m. OK PyPy 3-64 TESTS 7 311 3891200 1500
141168858 2019286 C Dec. 30, 2021, 2:08 p.m. OK PyPy 3-64 TESTS 7 312 5529600 1500
141142587 nicku123 C Dec. 30, 2021, 9:27 a.m. OK PyPy 3-64 TESTS 7 327 3584000 1500
141170326 MistaAsh C Dec. 30, 2021, 2:22 p.m. OK PyPy 3-64 TESTS 7 358 8499200 1500
141132569 OLOGY C Dec. 29, 2021, 6:27 p.m. OK Python 2 TESTS 6 187 102400 1500
141132636 OLOGY C Dec. 29, 2021, 6:27 p.m. OK Python 2 TESTS 6 218 102400 1500
141153619 OLOGY C Dec. 30, 2021, 11:27 a.m. OK Python 2 TESTS 7 280 102400 1500
141180790 _Shubham C Dec. 30, 2021, 4:27 p.m. OK Python 3 TESTS 7 187 0 1500
141202303 bronze_coder C Dec. 30, 2021, 10:54 p.m. OK Python 3 TESTS 7 295 0 1500
141134349 RoattTilma C Dec. 29, 2021, 6:44 p.m. OK Python 3 TESTS 7 545 0 1500
141192494 clause C Dec. 30, 2021, 6:54 p.m. OK Rust 2021 TESTS 7 15 0 1500
141191139 qwerty787788 C Dec. 30, 2021, 6:35 p.m. OK Rust 2021 TESTS 7 15 0 1500
141134821 apilat C Dec. 29, 2021, 6:49 p.m. OK Rust 2021 TESTS 7 31 0 1500

remove filters

Back to search problems