Codeforces Round 504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

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
1023 Codeforces Round 504 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) FINISHED False 8100 202922687 Aug. 17, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4059 ) D Array Restoration PROGRAMMING constructive algorithms data structures 1700

B'Initially there was an array a consisting of n integers. Positions in it are numbered from 1 to n . Exactly q queries were performed on the array. During the i -th query some segment (l_i, r_i) (1 <= l_i <= r_i <= n) was selected and values of elements on positions from l_i to r_i inclusive got changed to i . The order of the queries couldn 't be changed and all q queries were applied. It is also known that every position from 1 to n got covered by at least one segment. We could have offered you the problem about checking if some given array (consisting of n integers with values from 1 to q ) can be obtained by the aforementioned queries. However, we decided that it will come too easy for you. So the enhancement we introduced to it is the following. Some set of positions (possibly empty) in this array is selected and values of elements on these positions are set to 0 . Your task is to check if this array can be obtained by the aforementioned queries. Also if it can be obtained then restore this array. If there are multiple possible arrays then print any of them. The first line contains two integers n and q ( 1 <= n, q <= 2 cdot 10^5 ) -- the number of elements of the array and the number of queries perfomed on it. The second line contains n integer numbers a_1, a_2, ... , a_n ( 0 <= a_i <= q ) -- the resulting array. If element at some position j is equal to 0 then the value of element at this position can be any integer from 1 to q . Print "YES" if the array a can be obtained by performing q queries. Segments (l_i, r_i) (1 <= l_i <= r_i <= n) are chosen separately for each query. Every position from 1 to n should be covered by at least one segment. Otherwise print "NO". If some array can be obtained then print n integers on the second line -- t'...

Tutorials

Codeforces Round 504 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41726920 rr_ D Aug. 17, 2018, 7:26 p.m. OK D TESTS 74 124 11571200 1700
41802345 Gassa D Aug. 18, 2018, 7:25 p.m. OK D TESTS 75 124 11571200 1700
41728365 fluffyowl D Aug. 17, 2018, 8:08 p.m. OK D TESTS 74 124 22425600 1700
42599767 despair D Sept. 7, 2018, 3:44 a.m. OK D TESTS 75 140 11571200 1700
65902848 hos.lyric D Nov. 28, 2019, 9:33 a.m. OK D TESTS 75 140 22528000 1700
42129956 TShT D Aug. 26, 2018, 5:49 p.m. OK FPC TESTS 75 436 8704000 1700
41745049 AHTOH._. D Aug. 18, 2018, 7:19 a.m. OK FPC TESTS 74 452 6451200 1700
41731521 newbieski D Aug. 17, 2018, 10:34 p.m. OK GNU C TESTS 74 109 3174400 1700
41757906 utsav02 D Aug. 18, 2018, 1:03 p.m. OK GNU C++ TESTS 74 31 2457600 1700
41759543 utsav02 D Aug. 18, 2018, 1:52 p.m. OK GNU C++ TESTS 74 46 2457600 1700
41759483 utsav02 D Aug. 18, 2018, 1:50 p.m. OK GNU C++ TESTS 74 46 2457600 1700
41759406 utsav02 D Aug. 18, 2018, 1:47 p.m. OK GNU C++ TESTS 74 46 2457600 1700
41758059 utsav02 D Aug. 18, 2018, 1:07 p.m. OK GNU C++ TESTS 74 46 2457600 1700
41759062 utsav02 D Aug. 18, 2018, 1:36 p.m. OK GNU C++ TESTS 74 46 2560000 1700
41732447 luogu_bot3 D Aug. 17, 2018, 11:45 p.m. OK GNU C++ TESTS 74 46 12492800 1700
41744918 luogu_bot2 D Aug. 18, 2018, 7:16 a.m. OK GNU C++ TESTS 74 46 23961600 1700
41744263 luogu_bot1 D Aug. 18, 2018, 6:59 a.m. OK GNU C++ TESTS 74 46 23961600 1700
41721495 yanshannan D Aug. 17, 2018, 4:41 p.m. OK GNU C++ TESTS 74 61 12492800 1700
41769230 nitinjainec D Aug. 18, 2018, 3:06 p.m. OK GNU C++11 TESTS 74 31 3174400 1700
42721526 ReaLNero1 D Sept. 10, 2018, 2:09 a.m. OK GNU C++11 TESTS 75 46 3174400 1700
41760325 laofudasuan D Aug. 18, 2018, 2:15 p.m. OK GNU C++11 TESTS 74 46 7475200 1700
43033037 zhaotiensn D Sept. 18, 2018, 12:32 p.m. OK GNU C++11 TESTS 75 61 12390400 1700
46886777 fwat D Dec. 11, 2018, 1:38 a.m. OK GNU C++11 TESTS 75 62 9625600 1700
41745043 stevenzheng2002 D Aug. 18, 2018, 7:19 a.m. OK GNU C++11 TESTS 74 77 819200 1700
41809623 thewalker88 D Aug. 19, 2018, 1:59 a.m. OK GNU C++11 TESTS 75 78 2457600 1700
49052809 revolIA D Jan. 27, 2019, 11:53 a.m. OK GNU C++11 TESTS 75 78 5632000 1700
41731745 miaoxiankai D Aug. 17, 2018, 10:50 p.m. OK GNU C++11 TESTS 74 78 5632000 1700
42704247 Anson529 D Sept. 9, 2018, 12:17 p.m. OK GNU C++11 TESTS 75 78 6553600 1700
41804322 wleung_bvg D Aug. 18, 2018, 8:33 p.m. OK GNU C++14 TESTS 75 46 2457600 1700
41714102 wleung_bvg D Aug. 17, 2018, 4:06 p.m. OK GNU C++14 TESTS 74 46 2457600 1700
41755293 Al.Cash D Aug. 18, 2018, 11:43 a.m. OK GNU C++14 TESTS 74 46 3276800 1700
41716500 1247 D Aug. 17, 2018, 4:18 p.m. OK GNU C++14 TESTS 74 62 13516800 1700
41757740 humveea6 D Aug. 18, 2018, 12:58 p.m. OK GNU C++14 TESTS 74 93 819200 1700
47036440 hoiek12 D Dec. 15, 2018, 12:27 p.m. OK GNU C++14 TESTS 75 93 1638400 1700
45462950 henu_16l_lxl D Nov. 9, 2018, 2:54 a.m. OK GNU C++14 TESTS 75 93 1638400 1700
43371630 VLADO D Sept. 24, 2018, 2:47 p.m. OK GNU C++14 TESTS 75 93 1843200 1700
41747793 yvasant D Aug. 18, 2018, 8:17 a.m. OK GNU C++14 TESTS 74 93 2150400 1700
41890220 Manish_c D Aug. 20, 2018, 6:43 a.m. OK GNU C++14 TESTS 75 93 2355200 1700
42824594 DZYO D Sept. 13, 2018, 9:07 a.m. OK GNU C++17 TESTS 75 78 9113600 1700
41942744 NoDesire D Aug. 21, 2018, 4:31 p.m. OK GNU C++17 TESTS 75 93 819200 1700
41756572 zhangjiangyu D Aug. 18, 2018, 12:21 p.m. OK GNU C++17 TESTS 74 93 819200 1700
64616755 Kallaf D Nov. 10, 2019, 5:12 a.m. OK GNU C++17 TESTS 75 93 1433600 1700
41752835 AdvancerMan D Aug. 18, 2018, 10:29 a.m. OK GNU C++17 TESTS 74 93 1433600 1700
41871300 vsr625 D Aug. 19, 2018, 6:35 p.m. OK GNU C++17 TESTS 75 93 1638400 1700
54840163 digu_J D May 30, 2019, 12:26 p.m. OK GNU C++17 TESTS 75 93 1638400 1700
41870824 vsr625 D Aug. 19, 2018, 6:25 p.m. OK GNU C++17 TESTS 75 93 1638400 1700
41799469 deror1869107 D Aug. 18, 2018, 5:59 p.m. OK GNU C++17 TESTS 74 93 1638400 1700
41799256 deror1869107 D Aug. 18, 2018, 5:55 p.m. OK GNU C++17 TESTS 74 93 1638400 1700
60234748 chojh1222 D Sept. 7, 2019, 5:52 p.m. OK Java 8 TESTS 75 171 0 1700
47477708 kusomushi D Dec. 24, 2018, 11:30 p.m. OK Java 8 TESTS 75 187 3072000 1700
45288459 wadissimo D Nov. 4, 2018, 6:12 p.m. OK Java 8 TESTS 75 187 3072000 1700
65694399 ijxjdjd D Nov. 25, 2019, 7:07 a.m. OK Java 8 TESTS 75 187 5120000 1700
60270873 chojh1222 D Sept. 8, 2019, 3:26 p.m. OK Java 8 TESTS 75 202 0 1700
41714183 amolpratap007 D Aug. 17, 2018, 4:07 p.m. OK Java 8 TESTS 74 202 0 1700
41712519 alexyz D Aug. 17, 2018, 3:59 p.m. OK Java 8 TESTS 74 202 2150400 1700
41755349 sarthakmanna D Aug. 18, 2018, 11:45 a.m. OK Java 8 TESTS 74 202 2662400 1700
41714651 fnch D Aug. 17, 2018, 4:09 p.m. OK Java 8 TESTS 74 202 5120000 1700
41742421 Itwazonce D Aug. 18, 2018, 6:13 a.m. OK Java 8 TESTS 74 218 0 1700
41715074 Slamur D Aug. 17, 2018, 4:11 p.m. OK Kotlin TESTS 74 389 16998400 1700
56593047 toysheeyeyraku D July 5, 2019, 6:08 p.m. OK Mono C# TESTS 75 248 37785600 1700
42103365 keep.deep D Aug. 25, 2018, 9:11 p.m. OK Mono C# TESTS 75 545 27750400 1700
46923664 vjudge2 D Dec. 12, 2018, 7:06 a.m. OK MS C++ TESTS 75 93 1638400 1700
55197041 vjudge1 D June 6, 2019, 8:56 a.m. OK MS C++ TESTS 75 93 5017600 1700
42016147 ys1468362286 D Aug. 24, 2018, 6:27 a.m. OK MS C++ TESTS 75 139 5632000 1700
42016621 vjudge3 D Aug. 24, 2018, 6:42 a.m. OK MS C++ TESTS 75 155 5632000 1700
41714146 math957963 D Aug. 17, 2018, 4:06 p.m. OK MS C++ TESTS 74 156 8908800 1700
42459778 nomiku99 D Sept. 4, 2018, 1:11 p.m. OK MS C++ TESTS 75 186 26828800 1700
41737898 caustique D Aug. 18, 2018, 3:37 a.m. OK MS C++ TESTS 74 249 8908800 1700
42969370 aytio D Sept. 17, 2018, 4:46 a.m. OK MS C++ TESTS 75 264 3584000 1700
42606628 _mactep D Sept. 7, 2018, 8:20 a.m. OK MS C++ TESTS 75 311 4812800 1700
41718032 ag602326 D Aug. 17, 2018, 4:25 p.m. OK MS C++ TESTS 74 327 11980800 1700
41738836 _kawaii_neko_ D Aug. 18, 2018, 4:15 a.m. OK PyPy 2 TESTS 74 202 15872000 1700
41734593 aeternalis1 D Aug. 18, 2018, 1:35 a.m. OK PyPy 2 TESTS 74 888 24678400 1700
47089362 Praxis D Dec. 16, 2018, 4:24 a.m. OK PyPy 3 TESTS 75 467 28262400 1700
44034045 teitoku D Oct. 9, 2018, 12:11 p.m. OK PyPy 3 TESTS 75 499 20480000 1700
41726493 fat-fighter D Aug. 17, 2018, 7:18 p.m. OK Python 2 TESTS 74 499 17715200 1700
41722595 lisztfan D Aug. 17, 2018, 4:46 p.m. OK Python 2 TESTS 74 545 27443200 1700
41735449 Onesh0t D Aug. 18, 2018, 2:07 a.m. OK Python 2 TESTS 74 576 18636800 1700
41813512 Kaa D Aug. 19, 2018, 5:09 a.m. OK Python 3 TESTS 75 764 27443200 1700
42027285 wangzpeng D Aug. 24, 2018, 1:15 p.m. OK Python 3 TESTS 75 795 27136000 1700
41759912 Rockey D Aug. 18, 2018, 2:03 p.m. OK Python 3 TESTS 74 857 14336000 1700
41717537 sandro_barna D Aug. 17, 2018, 4:23 p.m. OK Python 3 TESTS 74 888 14028800 1700
45671950 cycleke D Nov. 13, 2018, 11:10 a.m. OK Python 3 TESTS 75 904 15974400 1700
41749634 betrue12 D Aug. 18, 2018, 9:02 a.m. OK Ruby TESTS 74 343 33996800 1700
41749459 vain0 D Aug. 18, 2018, 8:57 a.m. OK Rust TESTS 74 62 7065600 1700
62635613 sansen D Oct. 15, 2019, 4:44 p.m. OK Rust TESTS 75 77 7475200 1700
41716177 Leonardone D Aug. 17, 2018, 4:16 p.m. OK Rust TESTS 74 171 5324800 1700
42788248 AlexProk D Sept. 12, 2018, 6:24 a.m. OK Scala TESTS 75 686 27136000 1700
42790104 yakamoto D Sept. 12, 2018, 7:51 a.m. OK Scala TESTS 75 748 14848000 1700

remove filters

Back to search problems