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 |
---|---|---|---|---|---|---|
1990 | Codeforces Round 960 (Div. 2) | FINISHED | False | 7200 | 15693863 | July 20, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 12151 ) | C | Mad MAD Sum | PROGRAMMING | brute force greedy math |
B'We define the operatorname{MAD} (Maximum Appearing Duplicate) in an array as the largest number that appears at least twice in the array. Specifically, if there is no number that appears at least twice, the operatorname{MAD} value is 0 . For example, operatorname{MAD}([1, 2, 1]) = 1 , operatorname{MAD}([2, 2, 3, 3]) = 3 , operatorname{MAD}([1, 2, 3, 4]) = 0 . You are given an array a of size n . Initially, a variable sum is set to 0 . The following process will be executed in a sequential loop until all numbers in a become 0 : Find the value of sum after the process. The first line contains an integer t ( 1 <= q t <= q 2 cdot 10^4 ) -- the number of test cases. For each test case: It is guaranteed that the sum of n over all test cases will not exceed 2 cdot 10^5 . For each test case, output the value of sum in a new line. In the first test case, a=[1] initially. In the first loop: After the first loop, a=[0] and the process ends. The value of sum after the process is 1 . In the second test case, a=[2,2,3] initially. After the first loop, a=[0,2,2] and sum=7 . After the second loop, a=[0,0,2] and sum=11 . After the third loop, a=[0,0,0] and sum=13 . Then the process ends. The value of sum after the process is 13 . '... |
Video Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
271671667 | A1ternate | C | July 20, 2024, 9:39 p.m. | OK | C# 10 | TESTS | 17 | 234 | 40960000 | ||
271671749 | A1ternate | C | July 20, 2024, 9:40 p.m. | OK | C# 10 | TESTS | 17 | 327 | 39936000 | ||
271671781 | A1ternate | C | July 20, 2024, 9:40 p.m. | OK | C# 10 | TESTS | 17 | 343 | 39936000 | ||
271678806 | 4927618350 | C | July 21, 2024, 12:18 a.m. | OK | C++14 (GCC 6-32) | TESTS | 17 | 77 | 1638400 | ||
271700043 | Qingxing_H | C | July 21, 2024, 5:37 a.m. | OK | C++14 (GCC 6-32) | TESTS | 17 | 93 | 1024000 | ||
271680274 | whiliam | C | July 21, 2024, 12:52 a.m. | OK | C++14 (GCC 6-32) | TESTS | 17 | 93 | 1024000 | ||
271692053 | GeXiaowei | C | July 21, 2024, 3:52 a.m. | OK | C++14 (GCC 6-32) | TESTS | 17 | 93 | 1843200 | ||
271691953 | GeXiaowei | C | July 21, 2024, 3:51 a.m. | OK | C++14 (GCC 6-32) | TESTS | 17 | 93 | 1843200 | ||
271682757 | Yukii_P | C | July 21, 2024, 1:39 a.m. | OK | C++14 (GCC 6-32) | TESTS | 17 | 93 | 3276800 | ||
271685792 | SonYeuNuoc | C | July 21, 2024, 2:27 a.m. | OK | C++14 (GCC 6-32) | TESTS | 17 | 93 | 16076800 | ||
271684422 | _toothless | C | July 21, 2024, 2:06 a.m. | OK | C++14 (GCC 6-32) | TESTS | 17 | 108 | 0 | ||
271641291 | zerocloud01 | C | July 20, 2024, 5:40 p.m. | OK | C++14 (GCC 6-32) | TESTS | 15 | 108 | 2764800 | ||
271696510 | WSD33 | C | July 21, 2024, 4:52 a.m. | OK | C++14 (GCC 6-32) | TESTS | 17 | 108 | 4812800 | ||
271690187 | yaoye222 | C | July 21, 2024, 3:29 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 77 | 0 | ||
271689798 | ddl_yyds | C | July 21, 2024, 3:24 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 77 | 3993600 | ||
271689902 | Alonso_zz | C | July 21, 2024, 3:26 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 78 | 0 | ||
271694745 | dryfit | C | July 21, 2024, 4:29 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 78 | 0 | ||
271689941 | acfmidinsw | C | July 21, 2024, 3:26 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 78 | 0 | ||
271683226 | goodkillerchen | C | July 21, 2024, 1:46 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 78 | 0 | ||
271698583 | LilBunnyKing | C | July 21, 2024, 5:20 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 78 | 1024000 | ||
271695658 | xylaaa | C | July 21, 2024, 4:41 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 78 | 1024000 | ||
271684286 | wsqibking | C | July 21, 2024, 2:04 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 78 | 1024000 | ||
271696449 | 0x0c5cbae8 | C | July 21, 2024, 4:51 a.m. | OK | C++17 (GCC 7-32) | TESTS | 17 | 78 | 1126400 | ||
271682326 | RNS_JK | C | July 21, 2024, 1:32 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 62 | 0 | ||
271655925 | Master32WSP | C | July 20, 2024, 7:20 p.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 62 | 3993600 | ||
271695149 | Ngeces | C | July 21, 2024, 4:34 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 77 | 0 | ||
271694554 | May_27th | C | July 21, 2024, 4:26 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 77 | 0 | ||
271693914 | Mugi.Nekozane | C | July 21, 2024, 4:18 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 77 | 0 | ||
271693331 | learner_RR | C | July 21, 2024, 4:09 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 77 | 0 | ||
271688378 | 77Cream_puffs | C | July 21, 2024, 3:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 77 | 0 | ||
271693070 | learner_RR | C | July 21, 2024, 4:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 77 | 0 | ||
271698532 | HappyCodingLife. | C | July 21, 2024, 5:19 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 77 | 0 | ||
271696952 | mercyknight100 | C | July 21, 2024, 4:59 a.m. | OK | C++20 (GCC 13-64) | TESTS | 17 | 77 | 0 | ||
271650031 | lnsuyn | C | July 20, 2024, 6:28 p.m. | OK | GNU C11 | TESTS | 17 | 124 | 2560000 | ||
271641618 | SanjivDinakar | C | July 20, 2024, 5:41 p.m. | OK | GNU C11 | TESTS | 15 | 140 | 6553600 | ||
271673528 | rj3377295 | C | July 20, 2024, 10:14 p.m. | OK | Java 21 | TESTS | 17 | 280 | 716800 | ||
271643438 | mangos194 | C | July 20, 2024, 5:49 p.m. | OK | Java 21 | TESTS | 15 | 296 | 614400 | ||
271644286 | himanshu2208 | C | July 20, 2024, 5:53 p.m. | OK | Java 21 | TESTS | 16 | 312 | 1228800 | ||
271690548 | santuan | C | July 21, 2024, 3:34 a.m. | OK | Java 21 | TESTS | 17 | 312 | 9830400 | ||
271650007 | Alex_Toppo_06 | C | July 20, 2024, 6:28 p.m. | OK | Java 21 | TESTS | 17 | 359 | 8806400 | ||
271648598 | El-Psy-Congroo | C | July 20, 2024, 6:18 p.m. | OK | Java 21 | TESTS | 16 | 359 | 10137600 | ||
271654446 | sahasrad | C | July 20, 2024, 7:07 p.m. | OK | Java 21 | TESTS | 17 | 375 | 6758400 | ||
271647042 | codeWithDarshan | C | July 20, 2024, 6:08 p.m. | OK | Java 21 | TESTS | 16 | 390 | 409600 | ||
271648821 | ziad-abdou1 | C | July 20, 2024, 6:20 p.m. | OK | Java 21 | TESTS | 16 | 405 | 10240000 | ||
271644446 | Morkos | C | July 20, 2024, 5:54 p.m. | OK | Java 21 | TESTS | 16 | 406 | 9318400 | ||
271700796 | Mr.Numerator_007 | C | July 21, 2024, 5:45 a.m. | OK | Java 8 | TESTS | 17 | 140 | 0 | ||
271640924 | Safawt | C | July 20, 2024, 5:39 p.m. | OK | Java 8 | TESTS | 14 | 187 | 2764800 | ||
271653253 | kasiru_69 | C | July 20, 2024, 6:56 p.m. | OK | Java 8 | TESTS | 17 | 218 | 3993600 | ||
271655207 | Artistic_code | C | July 20, 2024, 7:13 p.m. | OK | Java 8 | TESTS | 17 | 218 | 6144000 | ||
271701601 | coderman2004 | C | July 21, 2024, 5:53 a.m. | OK | Java 8 | TESTS | 17 | 233 | 2662400 | ||
271671763 | henryz | C | July 20, 2024, 9:40 p.m. | OK | Java 8 | TESTS | 17 | 233 | 3993600 | ||
271646011 | PassedPawn | C | July 20, 2024, 6:02 p.m. | OK | Java 8 | TESTS | 16 | 281 | 5734400 | ||
271694186 | arajeev210 | C | July 21, 2024, 4:21 a.m. | OK | Java 8 | TESTS | 17 | 405 | 11673600 | ||
271645116 | Lakshay429 | C | July 20, 2024, 5:57 p.m. | OK | Java 8 | TESTS | 16 | 421 | 0 | ||
271648836 | Mr_A | C | July 20, 2024, 6:20 p.m. | OK | Java 8 | TESTS | 16 | 484 | 0 | ||
271641616 | aayush.mishra | C | July 20, 2024, 5:41 p.m. | OK | Kotlin 1.9 | TESTS | 15 | 468 | 0 | ||
271699823 | raunakgiri21 | C | July 21, 2024, 5:34 a.m. | OK | Node.js | TESTS | 17 | 327 | 42188800 | ||
271641159 | x3mka | C | July 20, 2024, 5:39 p.m. | OK | PyPy 3 | TESTS | 14 | 296 | 24268800 | ||
271683502 | Giantpanda | C | July 21, 2024, 1:51 a.m. | OK | PyPy 3 | TESTS | 17 | 312 | 24064000 | ||
271669393 | Freiden | C | July 20, 2024, 9:04 p.m. | OK | PyPy 3 | TESTS | 17 | 437 | 19865600 | ||
271651420 | raed.aroua | C | July 20, 2024, 6:39 p.m. | OK | PyPy 3 | TESTS | 17 | 452 | 14540800 | ||
271632161 | sokant | C | July 20, 2024, 4:33 p.m. | OK | PyPy 3 | TESTS | 14 | 468 | 14848000 | ||
271665966 | Sovi_11 | C | July 20, 2024, 8:23 p.m. | OK | PyPy 3 | TESTS | 17 | 468 | 19251200 | ||
271665602 | tan_delhi | C | July 20, 2024, 8:19 p.m. | OK | PyPy 3 | TESTS | 17 | 531 | 19046400 | ||
271676657 | Traverser_Steal69 | C | July 20, 2024, 11:22 p.m. | OK | PyPy 3 | TESTS | 17 | 578 | 21299200 | ||
271663368 | Arnoob2120 | C | July 20, 2024, 7:55 p.m. | OK | PyPy 3-64 | TESTS | 17 | 171 | 25497600 | ||
271700579 | tlsgusrb314 | C | July 21, 2024, 5:42 a.m. | OK | PyPy 3-64 | TESTS | 17 | 171 | 26214400 | ||
271694657 | My_skiff_passed_WChShan | C | July 21, 2024, 4:28 a.m. | OK | PyPy 3-64 | TESTS | 17 | 171 | 30617600 | ||
271698059 | rainy | C | July 21, 2024, 5:14 a.m. | OK | PyPy 3-64 | TESTS | 17 | 171 | 31436800 | ||
271654101 | eyobworku | C | July 20, 2024, 7:03 p.m. | OK | PyPy 3-64 | TESTS | 17 | 186 | 26726400 | ||
271654776 | verstrapp_1 | C | July 20, 2024, 7:10 p.m. | OK | PyPy 3-64 | TESTS | 17 | 186 | 26931200 | ||
271648760 | cecilia.chan | C | July 20, 2024, 6:19 p.m. | OK | PyPy 3-64 | TESTS | 16 | 187 | 28364800 | ||
271649878 | thewaxmango | C | July 20, 2024, 6:27 p.m. | OK | PyPy 3-64 | TESTS | 17 | 187 | 31744000 | ||
271689978 | jvatsal0709 | C | July 21, 2024, 3:27 a.m. | OK | PyPy 3-64 | TESTS | 17 | 187 | 34201600 | ||
271700900 | itsiftikar02 | C | July 21, 2024, 5:46 a.m. | OK | PyPy 3-64 | TESTS | 17 | 187 | 34611200 | ||
271671499 | Akash_iiitd | C | July 20, 2024, 9:36 p.m. | OK | Python 3 | TESTS | 17 | 296 | 28364800 | ||
271699751 | 21bec036 | C | July 21, 2024, 5:34 a.m. | OK | Python 3 | TESTS | 17 | 342 | 26112000 | ||
271647231 | adamO21 | C | July 20, 2024, 6:09 p.m. | OK | Python 3 | TESTS | 16 | 390 | 28672000 | ||
271698243 | _rahul11_ | C | July 21, 2024, 5:16 a.m. | OK | Python 3 | TESTS | 17 | 483 | 27340800 | ||
271671707 | HARSHdeep1234 | C | July 20, 2024, 9:39 p.m. | OK | Python 3 | TESTS | 17 | 593 | 29593600 | ||
271645387 | DeanMMenezes | C | July 20, 2024, 5:59 p.m. | OK | Rust 2021 | TESTS | 16 | 108 | 4812800 | ||
271645119 | fieubat2x | C | July 20, 2024, 5:57 p.m. | OK | Rust 2021 | TESTS | 16 | 109 | 12185600 | ||
271691990 | Bhscer | C | July 21, 2024, 3:51 a.m. | OK | Rust 2021 | TESTS | 17 | 140 | 5427200 |
Back to search problems