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 |
---|---|---|---|---|---|---|
1109 | Codeforces Round 539 (Div. 1) | FINISHED | False | 9000 | 187190723 | Feb. 16, 2019, 4:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 303 ) | F | Sasha and Algorithm of Silence's Sounds | PROGRAMMING | data structures trees | 3200 |
B'One fine day Sasha went to the park for a walk. In the park, he saw that his favorite bench is occupied, and he had to sit down on the neighboring one. He sat down and began to listen to the silence. Suddenly, he got a question: what if in different parts of the park, the silence sounds in different ways? So it was. Let 's divide the park into 1 x 1 meter squares and call them cells, and numerate rows from 1 to n from up to down, and columns from 1 to m from left to right. And now, every cell can be described with a pair of two integers (x, y) , where x -- the number of the row, and y -- the number of the column. Sasha knows that the level of silence in the cell (i, j) equals to f_{i,j} , and all f_{i,j} form a permutation of numbers from 1 to n cdot m . Sasha decided to count, how many are there pleasant segments of silence? Let 's take some segment [l ldots r] . Denote S as the set of cells (i, j) that l <= f_{i,j} <= r . Then, the segment of silence [l ldots r] is pleasant if there is only one simple path between every pair of cells from S (path can 't contain cells, which are not in S ). In other words, set S should look like a tree on a plain. Sasha has done this task pretty quickly, and called the algorithm -- "algorithm of silence 's sounds". Time passed, and the only thing left from the algorithm is a legend. To prove the truthfulness of this story, you have to help Sasha and to find the number of different pleasant segments of silence. Two segments [l_1 ldots r_1] , [l_2 ldots r_2] are different, if l_1 neq l_2 or r_1 neq r_2 or both at the same time. The first line contains two integers n and m ( 1 <= n, m <= 1000 , 1 <= n cdot m <= 2 cdot 10^5 ) -- the size of the park. Each from next n lines contains m integers f_{i,j} ( 1 <= f_{i,j} <= n'... |
Codeforces Round #539 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
51471551 | shadowice1984 | F | March 19, 2019, 6:50 a.m. | OK | GNU C++11 | TESTS | 62 | 156 | 17612800 | 3200 | |
52019554 | Durant_Lee | F | March 30, 2019, 12:02 p.m. | OK | GNU C++11 | TESTS | 62 | 156 | 19251200 | 3200 | |
51131289 | luogu_bot4 | F | March 10, 2019, 1:48 p.m. | OK | GNU C++11 | TESTS | 62 | 156 | 19353600 | 3200 | |
50093118 | GuessYCB | F | Feb. 18, 2019, 11:30 a.m. | OK | GNU C++11 | TESTS | 62 | 156 | 80281600 | 3200 | |
51471588 | luogu_bot3 | F | March 19, 2019, 6:51 a.m. | OK | GNU C++11 | TESTS | 62 | 171 | 17612800 | 3200 | |
51029517 | krijgertje | F | March 8, 2019, 1:10 p.m. | OK | GNU C++11 | TESTS | 62 | 171 | 18432000 | 3200 | |
52299005 | liyizhixl | F | April 4, 2019, 7:56 a.m. | OK | GNU C++11 | TESTS | 62 | 171 | 18534400 | 3200 | |
50597893 | Slr2002 | F | Feb. 28, 2019, 11:20 a.m. | OK | GNU C++11 | TESTS | 62 | 171 | 19353600 | 3200 | |
50531038 | leeson | F | Feb. 26, 2019, 1:39 p.m. | OK | GNU C++11 | TESTS | 62 | 171 | 19456000 | 3200 | |
50099010 | was_n | F | Feb. 18, 2019, 2:04 p.m. | OK | GNU C++11 | TESTS | 62 | 171 | 21094400 | 3200 | |
53601494 | hychyc | F | May 1, 2019, 7:57 a.m. | OK | GNU C++14 | TESTS | 62 | 202 | 20172800 | 3200 | |
50078039 | mayaohua2003 | F | Feb. 18, 2019, 12:37 a.m. | OK | GNU C++14 | TESTS | 62 | 217 | 18841600 | 3200 | |
51579912 | fwat | F | March 20, 2019, 2:08 p.m. | OK | GNU C++14 | TESTS | 62 | 218 | 20889600 | 3200 | |
53601565 | hychyc | F | May 1, 2019, 7:59 a.m. | OK | GNU C++14 | TESTS | 62 | 233 | 20172800 | 3200 | |
50143192 | yasugongshang | F | Feb. 19, 2019, 12:45 a.m. | OK | GNU C++14 | TESTS | 62 | 233 | 24166400 | 3200 | |
50093702 | qiqi20021026 | F | Feb. 18, 2019, 11:44 a.m. | OK | GNU C++14 | TESTS | 62 | 233 | 30105600 | 3200 | |
50162936 | mobu233 | F | Feb. 19, 2019, 1:24 p.m. | OK | GNU C++14 | TESTS | 62 | 233 | 81100800 | 3200 | |
50736700 | pairmann | F | March 3, 2019, 1:14 p.m. | OK | GNU C++14 | TESTS | 62 | 234 | 30105600 | 3200 | |
50059085 | zsyzsy | F | Feb. 17, 2019, 11:50 a.m. | OK | GNU C++14 | TESTS | 62 | 249 | 19763200 | 3200 | |
50548091 | alan_cty | F | Feb. 27, 2019, 12:13 a.m. | OK | GNU C++14 | TESTS | 62 | 249 | 20275200 | 3200 | |
53010109 | alonefight | F | April 19, 2019, 11:41 a.m. | OK | GNU C++17 | TESTS | 62 | 217 | 19148800 | 3200 | |
50259686 | newgate | F | Feb. 20, 2019, 10:43 p.m. | OK | GNU C++17 | TESTS | 62 | 218 | 19353600 | 3200 | |
52651674 | HatridMunSigra | F | April 12, 2019, 4:55 p.m. | OK | GNU C++17 | TESTS | 62 | 233 | 30105600 | 3200 | |
59094485 | Rose_max | F | Aug. 19, 2019, 1:45 p.m. | OK | GNU C++17 | TESTS | 62 | 249 | 20275200 | 3200 | |
51581405 | tkj | F | March 20, 2019, 2:37 p.m. | OK | GNU C++17 | TESTS | 62 | 249 | 25190400 | 3200 | |
50037757 | matthew99 | F | Feb. 16, 2019, 10:05 p.m. | OK | GNU C++17 | TESTS | 62 | 280 | 18944000 | 3200 | |
58849050 | superguyjm | F | Aug. 15, 2019, 6:43 a.m. | OK | GNU C++17 | TESTS | 62 | 358 | 16076800 | 3200 | |
63958070 | sincerity | F | Nov. 1, 2019, 3:21 a.m. | OK | GNU C++17 | TESTS | 62 | 374 | 21708800 | 3200 | |
50606165 | platypus179 | F | Feb. 28, 2019, 2:39 p.m. | OK | GNU C++17 | TESTS | 62 | 389 | 24064000 | 3200 | |
50038163 | Radewoosh | F | Feb. 16, 2019, 10:29 p.m. | OK | GNU C++17 | TESTS | 62 | 405 | 29286400 | 3200 | |
50244109 | KamilSL | F | Feb. 20, 2019, 2:09 p.m. | OK | Java 8 | TESTS | 62 | 545 | 40857600 | 3200 |
Back to search problems