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 |
1615
|
Codeforces Global Round 18 |
FINISHED |
False |
9000 |
96909863 |
Dec. 24, 2021, 2:35 p.m. |
Problems
B'You are given an array a consisting of n non-negative integers. You have to replace each 0 in a with an integer from 1 to n (different elements equal to 0 can be replaced by different integers). The value of the array you obtain is the number of integers k from 1 to n such that the following condition holds: there exist a pair of adjacent elements equal to k (i. xe2 x80 x89e. there exists some i in [1, n - 1] such that a_i = a_{i + 1} = k ). If there are multiple such pairs for some integer k , this integer is counted in the value only once. Your task is to obtain the array with the maximum possible value. The first line contains one integer n ( 2 <= n <= 3 cdot 10^5 ) -- the number of elements in the array. The second line contains n integers a_1, a_2, ... , a_n ( 0 <= a_i <= min(n, 600) ) -- the elements of the array. Print n integers not less than 1 and not greater than n -- the array with the maximum possible value you can obtain. If there are multiple answers, print any of them. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
140509112 |
gisp_zjz |
G |
Dec. 24, 2021, 5:33 p.m. |
OK |
GNU C++17 |
TESTS |
89 |
124 |
5939200 |
|
|
140508871 |
gisp_zjz |
G |
Dec. 24, 2021, 5:32 p.m. |
OK |
GNU C++17 |
TESTS |
89 |
124 |
5939200 |
|
|
140493600 |
inaFSTream |
G |
Dec. 24, 2021, 4:19 p.m. |
OK |
GNU C++17 |
TESTS |
89 |
124 |
15155200 |
|
|
140500993 |
DmitryGrigorev |
G |
Dec. 24, 2021, 4:46 p.m. |
OK |
GNU C++17 |
TESTS |
89 |
171 |
26009600 |
|
|
140503915 |
Talentkkggg |
G |
Dec. 24, 2021, 4:56 p.m. |
OK |
GNU C++17 |
TESTS |
89 |
186 |
61849600 |
|
|
140501696 |
lumibons |
G |
Dec. 24, 2021, 4:48 p.m. |
OK |
GNU C++17 (64) |
TESTS |
89 |
92 |
9113600 |
|
|
140504280 |
Petr |
G |
Dec. 24, 2021, 4:58 p.m. |
OK |
GNU C++17 (64) |
TESTS |
89 |
93 |
27648000 |
|
|
140510863 |
maroonrk |
G |
Dec. 24, 2021, 5:50 p.m. |
OK |
GNU C++17 (64) |
TESTS |
89 |
140 |
24576000 |
|
|
140501176 |
dengyaotriangle |
G |
Dec. 24, 2021, 4:46 p.m. |
OK |
GNU C++17 (64) |
TESTS |
89 |
171 |
39014400 |
|
|
140540026 |
xay5421 |
G |
Dec. 25, 2021, 5:02 a.m. |
OK |
GNU C++17 (64) |
TESTS |
90 |
234 |
14131200 |
|
|
140521252 |
ecnerwala |
G |
Dec. 24, 2021, 7:54 p.m. |
OK |
GNU C++17 (64) |
TESTS |
89 |
249 |
18944000 |
|
|
140503904 |
Miracle03 |
G |
Dec. 24, 2021, 4:56 p.m. |
OK |
GNU C++17 (64) |
TESTS |
89 |
249 |
30310400 |
|
|
140507912 |
Rafbill |
G |
Dec. 24, 2021, 5:25 p.m. |
OK |
GNU C++17 (64) |
TESTS |
89 |
264 |
30310400 |
|
|
140503360 |
_menhera |
G |
Dec. 24, 2021, 4:54 p.m. |
OK |
GNU C++17 (64) |
TESTS |
89 |
265 |
7680000 |
|
|
140498010 |
dorijanlendvaj |
G |
Dec. 24, 2021, 4:34 p.m. |
OK |
GNU C++17 (64) |
TESTS |
89 |
280 |
67481600 |
|
|
140510027 |
Krolo7 |
G |
Dec. 24, 2021, 5:41 p.m. |
OK |
GNU C++20 (64) |
TESTS |
89 |
77 |
8806400 |
|
|
140509278 |
jiangly |
G |
Dec. 24, 2021, 5:35 p.m. |
OK |
GNU C++20 (64) |
TESTS |
89 |
140 |
34816000 |
|
|
140503374 |
Ormlis |
G |
Dec. 24, 2021, 4:54 p.m. |
OK |
GNU C++20 (64) |
TESTS |
89 |
186 |
19456000 |
|
|
140519395 |
brunovsky |
G |
Dec. 24, 2021, 7:26 p.m. |
OK |
GNU C++20 (64) |
TESTS |
89 |
295 |
64921600 |
|
|
140497971 |
Vercingetorix |
G |
Dec. 24, 2021, 4:34 p.m. |
OK |
GNU C++20 (64) |
TESTS |
89 |
499 |
26419200 |
|
|
remove filters
Back to search problems