Codeforces Round 707 (Div. 1, based on Moscow Open Olympiad in Informatics)

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
1500 Codeforces Round 707 (Div. 1, based on Moscow Open Olympiad in Informatics) FINISHED False 9000 121640063 March 13, 2021, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 482 ) D Tiles for Bathroom PROGRAMMING two pointers 2900

B"Kostya is extremely busy: he is renovating his house! He needs to hand wallpaper, assemble furniture throw away trash. Kostya is buying tiles for bathroom today. He is standing in front of a large square stand with tiles in a shop. The stand is a square of n x n cells, each cell of which contains a small tile with color c_{i, ,j} . The shop sells tiles in packs: more specifically, you can only buy a subsquare of the initial square. A subsquare is any square part of the stand, i. e. any set S(i_0, j_0, k) = {c_{i, ,j} | i_0 <= i < i_0 + k, j_0 <= j < j_0 + k } with 1 <= i_0, j_0 <= n - k + 1 . Kostya still does not know how many tiles he needs, so he considers the subsquares of all possible sizes. He doesn't want his bathroom to be too colorful. Help Kostya to count for each k <= n the number of subsquares of size k x k that have at most q different colors of tiles. Two subsquares are considered different if their location on the stand is different. The first line contains two integers n and q ( 1 <= n <= 1500 , 1 <= q <= 10 ) -- the size of the stand and the limit on the number of distinct colors in a subsquare. Each of the next n lines contains n integers c_{i, ,j} ( 1 <= c_{i, ,j} <= n^2 ): the j -th integer in the i -th line is the color of the tile in the cell (i, ,j) . For each k from 1 to n print a single integer -- the number of subsquares of size k x k with no more than q different colors. In the first example all colors are distinct. Kostya doesn't want the subsquare have more than 4 colors, so he can buy any subsquare of size 1 x 1 or 2 x 2 , but he can't buy a subsquare of size 3 x 3 . In the second example there are colors that appear multiple times. Because q = 8 , Kostya can buy any subsquare of size 1 x 1 and 2 x 2 , and"...

Tutorials

Codeforces Round #707 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
109907819 Enkognit D March 13, 2021, 3:50 p.m. OK GNU C++11 TESTS 73 3540 13619200 2900
109875878 gisp_zjz D March 13, 2021, 10:53 a.m. OK GNU C++11 TESTS 72 4024 190668800 2900
109875506 ccf_n0i D March 13, 2021, 10:52 a.m. OK GNU C++14 TESTS 72 1668 18534400 2900
109929380 TiwAirOAO D March 14, 2021, 1:15 a.m. OK GNU C++14 TESTS 73 2573 208793600 2900
109893743 MinakamiMarisa D March 13, 2021, 1:14 p.m. OK GNU C++14 TESTS 72 2714 304640000 2900
109868138 DmitryGrigorev D March 13, 2021, 10:23 a.m. OK GNU C++14 TESTS 72 3571 220876800 2900
109884990 Amoo_Safar D March 13, 2021, 11:29 a.m. OK GNU C++14 TESTS 72 3665 11980800 2900
109885298 Noam527 D March 13, 2021, 11:30 a.m. OK GNU C++14 TESTS 72 3697 352460800 2900
109897901 BlueDiamond D March 13, 2021, 1:56 p.m. OK GNU C++14 TESTS 72 3743 229990400 2900
109875075 skywalkert D March 13, 2021, 10:50 a.m. OK GNU C++17 TESTS 72 1029 9523200 2900
109873581 huanwoshuifei D March 13, 2021, 10:44 a.m. OK GNU C++17 TESTS 72 1434 236032000 2900
109875304 hank55663 D March 13, 2021, 10:51 a.m. OK GNU C++17 TESTS 72 1575 229888000 2900
109885793 ItstInternationalTourist D March 13, 2021, 11:32 a.m. OK GNU C++17 TESTS 72 1949 263987200 2900
109882238 Dmitriy.Belichenko D March 13, 2021, 11:19 a.m. OK GNU C++17 TESTS 72 2682 276992000 2900
109878283 natsugiri D March 13, 2021, 11:03 a.m. OK GNU C++17 TESTS 72 2730 119705600 2900
109877726 ynsm D March 13, 2021, 11:01 a.m. OK GNU C++17 TESTS 72 3072 435712000 2900
109861346 krijgertje D March 13, 2021, 9:59 a.m. OK GNU C++17 TESTS 72 3665 245760000 2900
109903755 Elo D March 13, 2021, 2:58 p.m. OK GNU C++17 TESTS 72 3728 352563200 2900
109906619 islingr D March 13, 2021, 3:34 p.m. OK GNU C++17 TESTS 73 4086 202035200 2900
109901173 balbit D March 13, 2021, 2:29 p.m. OK GNU C++17 (64) TESTS 72 701 11673600 2900
109863287 Miracle03 D March 13, 2021, 10:05 a.m. OK GNU C++17 (64) TESTS 72 811 236134400 2900
109854472 ecnerwala D March 13, 2021, 9:38 a.m. OK GNU C++17 (64) TESTS 72 935 9625600 2900
109871552 gamegame D March 13, 2021, 10:36 a.m. OK GNU C++17 (64) TESTS 72 1216 244531200 2900
109880816 dario2994 D March 13, 2021, 11:13 a.m. OK GNU C++17 (64) TESTS 72 1372 464281600 2900
109928969 namespace_std D March 14, 2021, 12:52 a.m. OK GNU C++17 (64) TESTS 73 1450 487833600 2900
109883609 Xellos D March 13, 2021, 11:24 a.m. OK GNU C++17 (64) TESTS 72 1730 393216000 2900
109935936 heno239 D March 14, 2021, 4:44 a.m. OK GNU C++17 (64) TESTS 73 1793 19353600 2900
109879840 Elegia D March 13, 2021, 11:09 a.m. OK GNU C++17 (64) TESTS 72 1809 431820800 2900
109894516 kort0n D March 13, 2021, 1:23 p.m. OK GNU C++17 (64) TESTS 72 1871 426803200 2900
109872619 ocamler D March 13, 2021, 10:40 a.m. OK Rust TESTS 72 3744 436531200 2900

remove filters

Back to search problems