Codeforces Round 1059 (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
2162 Codeforces Round 1059 (Div. 3) FINISHED False 8100 15693923 Oct. 17, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 41306 ) A Beautiful Average PROGRAMMING brute force greedy

You are given an array (a) of length (n). Your task is to find the maximum possible average value of any subarray(^{\text{∗}}) of the array (a). Formally, for any indices (l, r) such that (1 \le l \le r \le n), define the average of the subarray (a_l, a_{l+1}, \dots, a_r) as the sum of elements divided by the number of elements or: ()avg(l,r) = \frac{1}{r-l+1} \sum_{i=l}^{r} a_i() Output the maximum value of (avg(l,r)) over all choices of (l, r). (^{\text{∗}})An array (b) is a subarray of an array (a) if (b) can be obtained from (a) by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. In particular, an array is a subarray of itself. The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. The first line of each testcase contains a single integer (n) ((1 \le n \le 10)) — the length of the array (a). The second line of each testcase contains (n) integers (a_1, a_2, \dots, a_n) ((1 \le a_i \le 10)) — the elements of the array. For each testcase, output a single integer — the maximum average of any subarray of the given array. It can be shown that the answer is always an integer.

Tutorials

Codeforces Round 1059 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
344578538 _moaz_2 A Oct. 19, 2025, 2:59 a.m. OK C# 10 TESTS 3 109 3072000
344495621 fahimsahriar A Oct. 18, 2025, 12:39 p.m. OK C# 13 TESTS 3 155 3379200
344505617 Vader_8455 A Oct. 18, 2025, 1:39 p.m. OK C++17 (GCC 7-32) TESTS 3 30 0
344554710 mohealdeenalkoor A Oct. 18, 2025, 6:56 p.m. OK C++17 (GCC 7-32) TESTS 3 31 0
344551702 is_destructible A Oct. 18, 2025, 6:29 p.m. OK C++17 (GCC 7-32) TESTS 3 31 0
344539551 xiaoxiao_xiaoxiao A Oct. 18, 2025, 5 p.m. OK C++17 (GCC 7-32) TESTS 3 31 0
344506944 AdSaw05_ A Oct. 18, 2025, 1:46 p.m. OK C++17 (GCC 7-32) TESTS 3 31 0
344418544 PhuongMaNHBa A Oct. 18, 2025, 1:51 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
344589003 adityashukla.sun A Oct. 19, 2025, 5:44 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
344588373 pcajourney A Oct. 19, 2025, 5:38 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
344587526 isaacbell A Oct. 19, 2025, 5:28 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
344586968 ea733. A Oct. 19, 2025, 5:22 a.m. OK C++17 (GCC 7-32) TESTS 3 46 0
344522601 Azkarizqullah A Oct. 18, 2025, 3:13 p.m. OK C++20 (GCC 13-64) TESTS 3 30 0
344427867 ayhamzaidd A Oct. 18, 2025, 4:11 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
344493819 mathworker21 A Oct. 18, 2025, 12:29 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
344574885 060524 A Oct. 19, 2025, 1:34 a.m. OK C++20 (GCC 13-64) TESTS 3 31 7987200
344591385 pranav_23 A Oct. 19, 2025, 6:06 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
344590385 daalbhaat A Oct. 19, 2025, 5:56 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
344585981 luuphucving A Oct. 19, 2025, 5:09 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
344585671 Hu_Laquan A Oct. 19, 2025, 5:05 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
344583884 PeterLong A Oct. 19, 2025, 4:36 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
344582487 Shakuu A Oct. 19, 2025, 4:13 a.m. OK C++20 (GCC 13-64) TESTS 3 46 0
344585842 zahid_jim A Oct. 19, 2025, 5:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
344582806 2401Huamanlou A Oct. 19, 2025, 4:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
344513909 qixinghui A Oct. 18, 2025, 2:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
344509115 xbai A Oct. 18, 2025, 1:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
344506066 wdakc A Oct. 18, 2025, 1:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
344495838 ankitkhatua A Oct. 18, 2025, 12:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
344432437 DBP_Heaven A Oct. 18, 2025, 5:02 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
344427703 soham_14 A Oct. 18, 2025, 4:10 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
344425048 Parthib_Saha A Oct. 18, 2025, 3:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 102400
344591365 yashwanth047 A Oct. 19, 2025, 6:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 46 0
344417803 yazecry A Oct. 18, 2025, 1:38 a.m. OK GNU C11 TESTS 3 46 102400
344526142 Pixelpip A Oct. 18, 2025, 3:35 p.m. OK GNU C11 TESTS 3 61 0
344546308 Umar_711 A Oct. 18, 2025, 5:48 p.m. OK GNU C11 TESTS 3 77 0
344530548 2024-3-60-676 A Oct. 18, 2025, 4:03 p.m. OK GNU C11 TESTS 3 77 0
344507213 Pratham2309 A Oct. 18, 2025, 1:47 p.m. OK GNU C11 TESTS 3 77 0
344505729 Fardinius A Oct. 18, 2025, 1:39 p.m. OK GNU C11 TESTS 3 77 0
344500247 md_faruk08 A Oct. 18, 2025, 1:06 p.m. OK GNU C11 TESTS 3 77 0
344587512 Meow006 A Oct. 19, 2025, 5:28 a.m. OK GNU C11 TESTS 3 77 102400
344584031 guojinxuan A Oct. 19, 2025, 4:39 a.m. OK GNU C11 TESTS 3 77 102400
344579960 rakibShami A Oct. 19, 2025, 3:27 a.m. OK GNU C11 TESTS 3 77 102400
344558010 altship A Oct. 18, 2025, 7:29 p.m. OK Go TESTS 3 61 1945600
344533882 harsha187 A Oct. 18, 2025, 4:25 p.m. OK Go TESTS 3 77 1024000
344539231 nikshaykataria3 A Oct. 18, 2025, 4:58 p.m. OK Java 21 TESTS 3 202 204800
344560030 gk_ A Oct. 18, 2025, 7:52 p.m. OK Java 21 TESTS 3 202 716800
344513605 amitabh.anandpd A Oct. 18, 2025, 2:21 p.m. OK Java 21 TESTS 3 217 204800
344523519 ojasrawat2072 A Oct. 18, 2025, 3:19 p.m. OK Java 21 TESTS 3 218 0
344510415 Ani17et A Oct. 18, 2025, 2:04 p.m. OK Java 21 TESTS 3 218 0
344525268 ojasrawat2072 A Oct. 18, 2025, 3:30 p.m. OK Java 21 TESTS 3 218 409600
344563355 kartik__sethi A Oct. 18, 2025, 8:32 p.m. OK Java 21 TESTS 3 218 1024000
344522665 ojasrawat2072 A Oct. 18, 2025, 3:14 p.m. OK Java 21 TESTS 3 233 0
344587720 Mantavy12 A Oct. 19, 2025, 5:30 a.m. OK Java 21 TESTS 3 233 614400
344424506 NooB__C0der A Oct. 18, 2025, 3:27 a.m. OK Java 21 TESTS 3 233 1024000
344560465 dimple_girl A Oct. 18, 2025, 7:57 p.m. OK Java 8 TESTS 3 140 0
344545996 KaranKamath A Oct. 18, 2025, 5:46 p.m. OK Java 8 TESTS 3 140 0
344504587 2manas1 A Oct. 18, 2025, 1:33 p.m. OK Java 8 TESTS 3 140 0
344525548 yashvardhan3 A Oct. 18, 2025, 3:31 p.m. OK Java 8 TESTS 3 155 0
344586624 the__Artist A Oct. 19, 2025, 5:17 a.m. OK Java 8 TESTS 3 156 0
344511383 Raghvendra7415 A Oct. 18, 2025, 2:09 p.m. OK Java 8 TESTS 3 171 0
344496846 Pranav_45 A Oct. 18, 2025, 12:46 p.m. OK Java 8 TESTS 3 171 39219200
344551049 newaz420 A Oct. 18, 2025, 6:24 p.m. OK Java 8 TESTS 3 186 0
344419719 baixuejava A Oct. 18, 2025, 2:12 a.m. OK Java 8 TESTS 3 187 0
344558768 johniscool76 A Oct. 18, 2025, 7:38 p.m. OK Java 8 TESTS 3 249 0
344542438 arif318khan A Oct. 18, 2025, 5:21 p.m. OK Kotlin 2.2 TESTS 3 233 102400
344427614 A_23 A Oct. 18, 2025, 4:08 a.m. OK Kotlin 2.2 TESTS 3 249 102400
344520063 alibichgaleleyev A Oct. 18, 2025, 2:58 p.m. OK Kotlin 2.2 TESTS 3 249 204800
344555241 OmarioVIC A Oct. 18, 2025, 7:01 p.m. OK Node.js TESTS 3 218 8601600
344537624 chrisc A Oct. 18, 2025, 4:48 p.m. OK Node.js TESTS 3 234 15564800
344556147 dachraouia193 A Oct. 18, 2025, 7:10 p.m. OK PyPy 3 TESTS 3 249 6041600
344419938 rgggr20 A Oct. 18, 2025, 2:16 a.m. OK PyPy 3 TESTS 3 327 6656000
344566824 Magnesia8 A Oct. 18, 2025, 9:26 p.m. OK PyPy 3 TESTS 3 327 7065600
344555087 dachraouia193 A Oct. 18, 2025, 7 p.m. OK PyPy 3 TESTS 3 342 6656000
344495561 sardor_sayfullayev A Oct. 18, 2025, 12:39 p.m. OK PyPy 3 TESTS 3 359 6758400
344427176 ChickenTamer A Oct. 18, 2025, 4:03 a.m. OK PyPy 3-64 TESTS 3 93 3891200
344428618 FirstCode1 A Oct. 18, 2025, 4:20 a.m. OK PyPy 3-64 TESTS 3 93 4403200
344546994 concavity19 A Oct. 18, 2025, 5:52 p.m. OK PyPy 3-64 TESTS 3 108 4403200
344571366 maurine26 A Oct. 18, 2025, 11:17 p.m. OK PyPy 3-64 TESTS 3 108 4505600
344423323 Aayush_69 A Oct. 18, 2025, 3:10 a.m. OK PyPy 3-64 TESTS 3 108 4505600
344531682 Ezra16 A Oct. 18, 2025, 4:11 p.m. OK PyPy 3-64 TESTS 3 109 4608000
344435279 opankit A Oct. 18, 2025, 5:27 a.m. OK PyPy 3-64 TESTS 3 124 4403200
344556386 Itrenbach A Oct. 18, 2025, 7:12 p.m. OK PyPy 3-64 TESTS 3 125 13209600
344513504 m_h4bib A Oct. 18, 2025, 2:21 p.m. OK PyPy 3-64 TESTS 3 140 3379200
344493192 opankit A Oct. 18, 2025, 12:26 p.m. OK PyPy 3-64 TESTS 3 140 4403200
344434098 saihrushita2508 A Oct. 18, 2025, 5:17 a.m. OK Python 3 TESTS 3 62 3481600
344426079 SushiTrash A Oct. 18, 2025, 3:49 a.m. OK Python 3 TESTS 3 77 0
344516227 TobiacFever A Oct. 18, 2025, 2:36 p.m. OK Python 3 TESTS 3 77 204800
344425587 Viv3k-r4m A Oct. 18, 2025, 3:42 a.m. OK Python 3 TESTS 3 93 204800
344510790 ehsansoltanm A Oct. 18, 2025, 2:06 p.m. OK Python 3 TESTS 3 93 3993600
344494325 ehsansoltanm A Oct. 18, 2025, 12:32 p.m. OK Python 3 TESTS 3 93 3993600
344559061 root2903 A Oct. 18, 2025, 7:41 p.m. OK Python 3 TESTS 3 108 0
344540179 ninjakilla A Oct. 18, 2025, 5:05 p.m. OK Python 3 TESTS 3 108 0
344419011 wannabe_coder_1877 A Oct. 18, 2025, 1:59 a.m. OK Python 3 TESTS 3 108 0
344579118 RautYashwardhan A Oct. 19, 2025, 3:11 a.m. OK Python 3 TESTS 3 109 0
344425109 MoSooN A Oct. 18, 2025, 3:35 a.m. OK Rust 2021 TESTS 3 92 0

remove filters

Back to search problems