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 |
---|---|---|---|---|---|---|
1845 | Educational Codeforces Round 151 (Rated for Div. 2) | FINISHED | False | 7200 | 43773899 | June 29, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 7921 ) | D | Rating System | PROGRAMMING | brute force data structures dp greedy implementation math |
B"You are developing a rating system for an online game. Every time a player participates in a match, the player's rating changes depending on the results. Initially, the player's rating is 0 . There are n matches; after the i -th match, the rating change is equal to a_i (the rating increases by a_i if a_i is positive, or decreases by |a_i| if it's negative. There are no zeros in the sequence a ). The system has an additional rule: for a fixed integer k , if a player's rating has reached the value k , it will never fall below it. Formally, if a player's rating at least k , and a rating change would make it less than k , then the rating will decrease to exactly k . Your task is to determine the value k in such a way that the player's rating after all n matches is the maximum possible (among all integer values of k ). If there are multiple possible answers, you can print any of them. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 3 cdot 10^5 ) -- the number of matches. The second line contains n integer a_1, a_2, ... , a_n ( -10^9 <= a_i <= 10^9 ; a_i ne 0 ) -- the rating change after the i -th match. The sum of n over all test cases doesn't exceed 3 cdot 10^5 . For each test case, print one integer m ( -10^{18} <= m <= 10^{18} ) -- the value of k such that the rating of the player will be the maximum possible when using this value. It can be shown that at least one of the optimal answers meets the constraint -10^{18} <= m <= 10^{18} . In the first example, if k=3 , then the rating changes as follows: 0 rightarrow 3 rightarrow 3 rightarrow 4 rightarrow 6 . In the second example, if k=0 , then the rating changes as follows: 0 rightarrow 0 "... |
117791 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
211564903 | AutumnMist | D | June 30, 2023, 3:04 a.m. | OK | C# 10 | TESTS | 9 | 93 | 34304000 | ||
211565057 | AutumnMist | D | June 30, 2023, 3:06 a.m. | OK | C# 10 | TESTS | 9 | 93 | 34406400 | ||
211564994 | AutumnMist | D | June 30, 2023, 3:05 a.m. | OK | C# 10 | TESTS | 9 | 93 | 34406400 | ||
211524106 | AutumnMist | D | June 29, 2023, 4:30 p.m. | OK | C# 10 | TESTS | 7 | 109 | 34508800 | ||
211564786 | Eznibuil | D | June 30, 2023, 3:02 a.m. | OK | GNU C++14 | TESTS | 9 | 62 | 3584000 | ||
211563249 | zhouyou8175095 | D | June 30, 2023, 2:35 a.m. | OK | GNU C++14 | TESTS | 9 | 77 | 3584000 | ||
211558970 | mwzqwq | D | June 30, 2023, 12:53 a.m. | OK | GNU C++14 | TESTS | 9 | 78 | 3584000 | ||
211556546 | sybsyb | D | June 29, 2023, 11:45 p.m. | OK | GNU C++14 | TESTS | 9 | 78 | 6041600 | ||
211538136 | Elderidge | D | June 29, 2023, 5:58 p.m. | OK | GNU C++14 | TESTS | 7 | 78 | 7168000 | ||
211540902 | Daniil-2006 | D | June 29, 2023, 6:28 p.m. | OK | GNU C++14 | TESTS | 7 | 92 | 7168000 | ||
211564626 | Aladdin_drink_H2O | D | June 30, 2023, 3 a.m. | OK | GNU C++14 | TESTS | 9 | 93 | 0 | ||
211561254 | Fuad37 | D | June 30, 2023, 1:53 a.m. | OK | GNU C++14 | TESTS | 9 | 93 | 0 | ||
211556125 | CarlosDaniel111 | D | June 29, 2023, 11:33 p.m. | OK | GNU C++14 | TESTS | 9 | 93 | 0 | ||
211549800 | MoshiKikiyama | D | June 29, 2023, 8:43 p.m. | OK | GNU C++14 | TESTS | 7 | 93 | 0 | ||
211557404 | zhangyuanyu | D | June 30, 2023, 12:11 a.m. | OK | GNU C++17 | TESTS | 9 | 77 | 0 | ||
211551988 | dreamy_jasper | D | June 29, 2023, 9:34 p.m. | OK | GNU C++17 | TESTS | 7 | 77 | 6041600 | ||
211556349 | luoZH111 | D | June 29, 2023, 11:38 p.m. | OK | GNU C++17 | TESTS | 9 | 78 | 0 | ||
211532945 | Kirigakure_Saizo | D | June 29, 2023, 5:08 p.m. | OK | GNU C++17 | TESTS | 7 | 78 | 0 | ||
211531458 | ukaniirfan | D | June 29, 2023, 4:57 p.m. | OK | GNU C++17 | TESTS | 7 | 78 | 0 | ||
211558368 | mohamedeltair | D | June 30, 2023, 12:37 a.m. | OK | GNU C++17 | TESTS | 9 | 78 | 3584000 | ||
211559195 | NKheyuxiang | D | June 30, 2023, 12:59 a.m. | OK | GNU C++17 | TESTS | 9 | 78 | 6041600 | ||
211565705 | aaaaa123 | D | June 30, 2023, 3:18 a.m. | OK | GNU C++17 | TESTS | 9 | 78 | 6656000 | ||
211537681 | dhakaprashant666 | D | June 29, 2023, 5:53 p.m. | OK | GNU C++17 | TESTS | 7 | 92 | 2457600 | ||
211572723 | SackSia | D | June 30, 2023, 5:18 a.m. | OK | GNU C++17 | TESTS | 9 | 93 | 0 | ||
211551286 | yh11 | D | June 29, 2023, 9:18 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 46 | 3584000 | ||
211563644 | tomato_potato | D | June 30, 2023, 2:42 a.m. | OK | GNU C++17 (64) | TESTS | 9 | 61 | 2662400 | ||
211547693 | yh11 | D | June 29, 2023, 8:04 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 61 | 3584000 | ||
211533235 | najmul__nayeem | D | June 29, 2023, 5:10 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 61 | 4812800 | ||
211531158 | Jieneng | D | June 29, 2023, 4:55 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 61 | 4812800 | ||
211558460 | Alex_Wei | D | June 30, 2023, 12:40 a.m. | OK | GNU C++17 (64) | TESTS | 9 | 61 | 5836800 | ||
211552253 | enslaved | D | June 29, 2023, 9:41 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 61 | 6041600 | ||
211544199 | MUNISJONI_KHURSHEDJON | D | June 29, 2023, 7:11 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 61 | 7168000 | ||
211566965 | mePranav | D | June 30, 2023, 3:39 a.m. | OK | GNU C++17 (64) | TESTS | 9 | 61 | 7270400 | ||
211566842 | mePranav | D | June 30, 2023, 3:37 a.m. | OK | GNU C++17 (64) | TESTS | 9 | 61 | 7270400 | ||
211532901 | MattTheNub | D | June 29, 2023, 5:08 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 31 | 1228800 | ||
211557782 | itz_itachi | D | June 30, 2023, 12:22 a.m. | OK | GNU C++20 (64) | TESTS | 9 | 31 | 6860800 | ||
211557754 | itz_pattanaik | D | June 30, 2023, 12:22 a.m. | OK | GNU C++20 (64) | TESTS | 9 | 31 | 6860800 | ||
211571861 | Anshul_Mittal | D | June 30, 2023, 5:06 a.m. | OK | GNU C++20 (64) | TESTS | 9 | 46 | 0 | ||
211571161 | NanYangNanChui | D | June 30, 2023, 4:54 a.m. | OK | GNU C++20 (64) | TESTS | 9 | 46 | 0 | ||
211566424 | codemonster2 | D | June 30, 2023, 3:29 a.m. | OK | GNU C++20 (64) | TESTS | 9 | 46 | 0 | ||
211565513 | G.Strawn | D | June 30, 2023, 3:14 a.m. | OK | GNU C++20 (64) | TESTS | 9 | 46 | 0 | ||
211556114 | Tsupa_Roman | D | June 29, 2023, 11:33 p.m. | OK | GNU C++20 (64) | TESTS | 9 | 46 | 0 | ||
211548865 | ibrm | D | June 29, 2023, 8:26 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 46 | 0 | ||
211543261 | mojumoju | D | June 29, 2023, 6:58 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 46 | 0 | ||
211540435 | totally_notAcat | D | June 29, 2023, 6:22 p.m. | OK | Haskell | TESTS | 7 | 1387 | 116633600 | ||
211548082 | sheath_n_sword | D | June 29, 2023, 8:12 p.m. | OK | Java 11 | TESTS | 7 | 234 | 0 | ||
211539424 | csullivan203 | D | June 29, 2023, 6:11 p.m. | OK | Java 11 | TESTS | 7 | 249 | 3891200 | ||
211536313 | dzhi | D | June 29, 2023, 5:39 p.m. | OK | Java 11 | TESTS | 7 | 264 | 3993600 | ||
211534646 | dzhi | D | June 29, 2023, 5:23 p.m. | OK | Java 11 | TESTS | 7 | 265 | 7270400 | ||
211547729 | kasiru_69 | D | June 29, 2023, 8:05 p.m. | OK | Java 11 | TESTS | 7 | 280 | 6348800 | ||
211533312 | dzhi | D | June 29, 2023, 5:11 p.m. | OK | Java 11 | TESTS | 7 | 280 | 7270400 | ||
211531455 | Siyaram_13 | D | June 29, 2023, 4:57 p.m. | OK | Java 11 | TESTS | 7 | 311 | 6451200 | ||
211546863 | butteronpoptart | D | June 29, 2023, 7:51 p.m. | OK | Java 11 | TESTS | 7 | 576 | 0 | ||
211525085 | WvemiY9 | D | June 29, 2023, 4:31 p.m. | OK | Java 11 | TESTS | 7 | 1122 | 0 | ||
211574981 | aks_den | D | June 30, 2023, 5:48 a.m. | OK | Java 17 | TESTS | 9 | 233 | 6348800 | ||
211542620 | vaibhav_1710 | D | June 29, 2023, 6:50 p.m. | OK | Java 17 | TESTS | 7 | 233 | 11366400 | ||
211552440 | miminguci | D | June 29, 2023, 9:45 p.m. | OK | Java 17 | TESTS | 7 | 249 | 3788800 | ||
211546486 | mcrash12 | D | June 29, 2023, 7:45 p.m. | OK | Java 17 | TESTS | 7 | 280 | 4812800 | ||
211550650 | AK18.java | D | June 29, 2023, 9:03 p.m. | OK | Java 17 | TESTS | 7 | 280 | 6451200 | ||
211546652 | mcrash12 | D | June 29, 2023, 7:47 p.m. | OK | Java 17 | TESTS | 7 | 296 | 4812800 | ||
211575803 | LeetCodeforces_Null | D | June 30, 2023, 5:57 a.m. | OK | Java 17 | TESTS | 9 | 296 | 5734400 | ||
211557857 | wizardleen | D | June 30, 2023, 12:25 a.m. | OK | Java 17 | TESTS | 9 | 296 | 22630400 | ||
211546291 | mcrash12 | D | June 29, 2023, 7:42 p.m. | OK | Java 17 | TESTS | 7 | 343 | 9420800 | ||
211537047 | swapnil159 | D | June 29, 2023, 5:46 p.m. | OK | Java 17 | TESTS | 7 | 405 | 41676800 | ||
211552602 | Sussykin | D | June 29, 2023, 9:50 p.m. | OK | Java 8 | TESTS | 7 | 109 | 0 | ||
211543338 | UniversalAdmin | D | June 29, 2023, 6:59 p.m. | OK | Java 8 | TESTS | 7 | 265 | 15872000 | ||
211539970 | ayata | D | June 29, 2023, 6:17 p.m. | OK | MS C++ 2017 | TESTS | 7 | 295 | 0 | ||
211529278 | Gean57 | D | June 29, 2023, 4:43 p.m. | OK | MS C++ 2017 | TESTS | 7 | 312 | 0 | ||
211565037 | ZrjaK | D | June 30, 2023, 3:06 a.m. | OK | PyPy 3 | TESTS | 9 | 358 | 38400000 | ||
211543402 | prabhat_7167 | D | June 29, 2023, 7 p.m. | OK | PyPy 3 | TESTS | 7 | 420 | 25088000 | ||
211530485 | monji | D | June 29, 2023, 4:50 p.m. | OK | PyPy 3 | TESTS | 7 | 451 | 35430400 | ||
211529988 | Victor3333 | D | June 29, 2023, 4:47 p.m. | OK | PyPy 3 | TESTS | 7 | 452 | 32563200 | ||
211533947 | Leeisateam | D | June 29, 2023, 5:16 p.m. | OK | PyPy 3 | TESTS | 7 | 545 | 42905600 | ||
211562875 | shehebe | D | June 30, 2023, 2:28 a.m. | OK | PyPy 3 | TESTS | 9 | 546 | 48640000 | ||
211542743 | prabhat_7167 | D | June 29, 2023, 6:51 p.m. | OK | PyPy 3 | TESTS | 7 | 561 | 44032000 | ||
211533081 | kavorka | D | June 29, 2023, 5:09 p.m. | OK | PyPy 3-64 | TESTS | 7 | 109 | 32460800 | ||
211548164 | beethoven97 | D | June 29, 2023, 8:13 p.m. | OK | PyPy 3-64 | TESTS | 7 | 124 | 32051200 | ||
211548292 | KanishkGoel | D | June 29, 2023, 8:15 p.m. | OK | PyPy 3-64 | TESTS | 7 | 124 | 43724800 | ||
211573173 | gardengnome | D | June 30, 2023, 5:24 a.m. | OK | PyPy 3-64 | TESTS | 9 | 124 | 44134400 | ||
211563035 | SoleProprietor | D | June 30, 2023, 2:31 a.m. | OK | PyPy 3-64 | TESTS | 9 | 124 | 46080000 | ||
211541758 | pedastrian57 | D | June 29, 2023, 6:38 p.m. | OK | PyPy 3-64 | TESTS | 7 | 124 | 161075200 | ||
211548112 | beethoven97 | D | June 29, 2023, 8:12 p.m. | OK | PyPy 3-64 | TESTS | 7 | 140 | 32051200 | ||
211528769 | liupengsay | D | June 29, 2023, 4:40 p.m. | OK | PyPy 3-64 | TESTS | 7 | 140 | 39014400 | ||
211567468 | gardengnome | D | June 30, 2023, 3:48 a.m. | OK | PyPy 3-64 | TESTS | 9 | 140 | 44441600 | ||
211527232 | xuhao95 | D | June 29, 2023, 4:34 p.m. | OK | PyPy 3-64 | TESTS | 7 | 140 | 46284800 | ||
211526634 | srahulsriram | D | June 29, 2023, 4:34 p.m. | OK | Python 3 | TESTS | 7 | 233 | 39219200 | ||
211533313 | vadim.golubtsov | D | June 29, 2023, 5:11 p.m. | OK | Python 3 | TESTS | 7 | 265 | 39628800 | ||
211529200 | rohanmitra2420 | D | June 29, 2023, 4:43 p.m. | OK | Python 3 | TESTS | 7 | 265 | 39833600 | ||
211565024 | ZrjaK | D | June 30, 2023, 3:06 a.m. | OK | Python 3 | TESTS | 9 | 280 | 41574400 | ||
211560875 | aeternalis1 | D | June 30, 2023, 1:44 a.m. | OK | Python 3 | TESTS | 9 | 311 | 39628800 | ||
211532250 | kishan.ved | D | June 29, 2023, 5:02 p.m. | OK | Python 3 | TESTS | 7 | 312 | 39628800 | ||
211536559 | kematian | D | June 29, 2023, 5:42 p.m. | OK | Python 3 | TESTS | 7 | 499 | 58470400 | ||
211533942 | Leeisateam | D | June 29, 2023, 5:16 p.m. | OK | Python 3 | TESTS | 7 | 499 | 58470400 | ||
211534390 | Saad_Nabil_Rimeh | D | June 29, 2023, 5:20 p.m. | OK | Python 3 | TESTS | 7 | 514 | 58572800 | ||
211529597 | dm22dm | D | June 29, 2023, 4:45 p.m. | OK | Python 3 | TESTS | 7 | 514 | 58572800 | ||
211546800 | mr_sparkle70 | D | June 29, 2023, 7:50 p.m. | OK | Ruby 3 | TESTS | 7 | 623 | 33075200 | ||
211536938 | yllo | D | June 29, 2023, 5:45 p.m. | OK | Rust 2021 | TESTS | 7 | 93 | 17510400 | ||
211535871 | yllo | D | June 29, 2023, 5:35 p.m. | OK | Rust 2021 | TESTS | 7 | 108 | 17510400 |
Back to search problems