Codeforces Round 727 (Div. 2)

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
1539 Codeforces Round 727 (Div. 2) FINISHED False 7200 112996463 June 20, 2021, 10:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 895 ) F Strange Array PROGRAMMING data structures greedy sortings 2600

B"Vasya has an array of n integers a_1, a_2, ldots, a_n . Vasya thinks that all numbers in his array are strange for some reason. To calculate how strange the i -th number is, Vasya created the following algorithm. He chooses a subsegment a_l, a_{l+1}, ldots, a_r , such that 1 <= l <= i <= r <= n , sort its elements in increasing order in his head (he can arrange equal elements arbitrary). After that he finds the center of the segment. The center of a segment is the element at position (l + r) / 2 , if the length of the segment is odd, and at position (l + r + 1) / 2 otherwise. Now Vasya finds the element that was at position i before the sorting, and calculates the distance between its current position and the center of the subsegment (the distance between the elements with indices j and k is |j - k| ). The strangeness of the number at position i is the maximum distance among all suitable choices of l and r . Vasya wants to calculate the strangeness of each number in his array. Help him to do it. The first line contains a single integer n ( 1 <= n <= 200 ,000 ) -- the size of the array. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ) -- Vasya's array. Print a single line with n numbers. The i -th of them must be equal to the strangeness of the i -th element of the array. In the first example: "...

Tutorials

tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
120131839 Big_black_red_date F June 20, 2021, 1:46 p.m. OK GNU C++11 TESTS 112 280 16896000 2600
120126074 gary888 F June 20, 2021, 1:06 p.m. OK GNU C++11 TESTS 112 343 26419200 2600
120142399 Stern_des_Sudens F June 20, 2021, 3:23 p.m. OK GNU C++11 TESTS 112 358 16896000 2600
120169188 Little-aztl F June 21, 2021, 2:54 a.m. OK GNU C++11 TESTS 112 358 36044800 2600
120131687 LoveDancing F June 20, 2021, 1:45 p.m. OK GNU C++11 TESTS 112 373 13619200 2600
120141632 chen_03 F June 20, 2021, 3:16 p.m. OK GNU C++11 TESTS 112 389 23244800 2600
120148408 refresh888 F June 20, 2021, 4:30 p.m. OK GNU C++11 TESTS 112 390 22425600 2600
120147864 lyyousa F June 20, 2021, 4:23 p.m. OK GNU C++11 TESTS 112 405 19251200 2600
120168191 2114992323 F June 21, 2021, 2:21 a.m. OK GNU C++11 TESTS 112 405 45670400 2600
120165839 pikapikachu F June 21, 2021, 12:40 a.m. OK GNU C++11 TESTS 112 420 21708800 2600
120150492 Dancing F June 20, 2021, 5:01 p.m. OK GNU C++14 TESTS 112 373 13721600 2600
120167415 SuperJ6 F June 21, 2021, 1:51 a.m. OK GNU C++14 TESTS 112 421 34713600 2600
120131574 Da_H_G F June 20, 2021, 1:44 p.m. OK GNU C++14 TESTS 112 529 22118400 2600
120138895 Komeiji_Green F June 20, 2021, 2:50 p.m. OK GNU C++14 TESTS 112 608 10444800 2600
120163504 mat_v F June 20, 2021, 10:07 p.m. OK GNU C++14 TESTS 112 639 16998400 2600
120147082 Sixpathsguy F June 20, 2021, 4:12 p.m. OK GNU C++14 TESTS 112 951 75776000 2600
120127449 ankit_1107 F June 20, 2021, 1:13 p.m. OK GNU C++14 TESTS 112 1855 123596800 2600
120131633 cxt F June 20, 2021, 1:45 p.m. OK GNU C++17 TESTS 112 280 11366400 2600
120130074 CuCl2 F June 20, 2021, 1:32 p.m. OK GNU C++17 TESTS 112 311 13721600 2600
120142982 vhnvn F June 20, 2021, 3:28 p.m. OK GNU C++17 TESTS 112 390 17920000 2600
120126675 rama_pang F June 20, 2021, 1:08 p.m. OK GNU C++17 TESTS 112 420 20275200 2600
120148451 vhnvn F June 20, 2021, 4:31 p.m. OK GNU C++17 TESTS 112 421 22732800 2600
120142599 CSQ31 F June 20, 2021, 3:25 p.m. OK GNU C++17 TESTS 112 436 16793600 2600
120126169 C20191629 F June 20, 2021, 1:06 p.m. OK GNU C++17 TESTS 112 451 23244800 2600
120157052 Cosmoden F June 20, 2021, 6:51 p.m. OK GNU C++17 TESTS 112 467 18432000 2600
120131250 oipotato F June 20, 2021, 1:41 p.m. OK GNU C++17 TESTS 112 468 11980800 2600
120126037 Yang_Lin F June 20, 2021, 1:06 p.m. OK GNU C++17 TESTS 112 483 28364800 2600
120159298 erray F June 20, 2021, 7:43 p.m. OK GNU C++17 (64) TESTS 112 312 7270400 2600
120168068 AutumnKite F June 21, 2021, 2:17 a.m. OK GNU C++17 (64) TESTS 112 342 15974400 2600
120126136 Rainybunny F June 20, 2021, 1:06 p.m. OK GNU C++17 (64) TESTS 112 343 19251200 2600
120165175 nocriz F June 21, 2021, 12:04 a.m. OK GNU C++17 (64) TESTS 112 358 7270400 2600
120138480 congthanh123 F June 20, 2021, 2:46 p.m. OK GNU C++17 (64) TESTS 112 358 16896000 2600
120146543 kitsune F June 20, 2021, 4:06 p.m. OK GNU C++17 (64) TESTS 112 358 18432000 2600
120138699 Thallium54 F June 20, 2021, 2:48 p.m. OK GNU C++17 (64) TESTS 112 358 27340800 2600
120166301 bkifhr10 F June 21, 2021, 1:04 a.m. OK GNU C++17 (64) TESTS 112 373 13721600 2600
120125782 clam F June 20, 2021, 1:05 p.m. OK GNU C++17 (64) TESTS 112 373 41779200 2600
120131502 shjohw12 F June 20, 2021, 1:43 p.m. OK GNU C++17 (64) TESTS 112 374 24064000 2600
120126033 insert_cool_handle F June 20, 2021, 1:06 p.m. OK Java 11 TESTS 112 1809 74444800 2600
120125972 Ji_Kuai F June 20, 2021, 1:06 p.m. OK Kotlin TESTS 112 1574 33177600 2600
120173547 xsc F June 21, 2021, 4:42 a.m. OK MS C++ 2017 TESTS 112 390 13721600 2600
120165726 mban259 F June 21, 2021, 12:35 a.m. OK .NET Core C# TESTS 112 1185 49254400 2600

remove filters

Back to search problems