Codeforces Round 510 (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
1042 Codeforces Round 510 (Div. 2) FINISHED False 7200 200354123 Sept. 17, 2018, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1827 ) E Vasya and Magic Matrix PROGRAMMING dp math probabilities 2300

B"Vasya has got a magic matrix a of size n x m . The rows of the matrix are numbered from 1 to n from top to bottom, the columns are numbered from 1 to m from left to right. Let a_{ij} be the element in the intersection of the i -th row and the j -th column. Vasya has also got a chip. Initially, the chip is in the intersection of the r -th row and the c -th column (that is, in the element a_{rc} ). Vasya performs the following process as long as possible: among all elements of the matrix having their value less than the value of the element with the chip in it, Vasya randomly and equiprobably chooses one element and moves his chip to this element. After moving the chip, he adds to his score the square of the Euclidean distance between these elements (that is, between the element in which the chip is now and the element the chip was moved from). The process ends when there are no elements having their values less than the value of the element with the chip in it. Euclidean distance between matrix elements with coordinates (i_1, j_1) and (i_2, j_2) is equal to sqrt{(i_1-i_2)^2 + (j_1-j_2)^2} . Calculate the expected value of the Vasya's final score. It can be shown that the answer can be represented as frac{P}{Q} , where P and Q are coprime integer numbers, and Q not equiv 0~(mod ~ 998244353) . Print the value P cdot Q^{-1} modulo 998244353 . The first line of the input contains two integers n and m (1 <= n, m <= 1 ,000) -- the number of rows and the number of columns in the matrix a . The following n lines contain description of the matrix a . The i -th line contains m integers a_{i1}, a_{i2}, ... , a_{im} ~ (0 <= a_{ij} <= 10^9) . The following line contains two integers r and c (1 <= r <= n, 1 <= c <= m) -- the index of row and the index of column where the"...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
43019394 ccosi E Sept. 18, 2018, 3:06 a.m. OK GNU C++11 TESTS 41 202 16076800 2300
64318008 Kylin_ E Nov. 5, 2019, 2:42 p.m. OK GNU C++11 TESTS 41 233 27852800 2300
44340164 DntcryBecthlev E Oct. 15, 2018, 2:38 a.m. OK GNU C++11 TESTS 41 233 40038400 2300
47020856 luogu_bot2 E Dec. 15, 2018, 1:31 a.m. OK GNU C++11 TESTS 41 249 20070400 2300
46852753 stal_xy23z7b8 E Dec. 10, 2018, 1:09 p.m. OK GNU C++11 TESTS 41 249 20070400 2300
42993494 yybyyb E Sept. 17, 2018, 11:14 a.m. OK GNU C++11 TESTS 41 249 20480000 2300
43407904 luogu_bot5 E Sept. 25, 2018, 12:17 p.m. OK GNU C++11 TESTS 41 249 20787200 2300
44751563 ReaLNero1 E Oct. 23, 2018, 8:13 p.m. OK GNU C++11 TESTS 41 249 40038400 2300
54503731 __23333 E May 23, 2019, 1:28 a.m. OK GNU C++11 TESTS 41 249 60108800 2300
43021339 neal E Sept. 18, 2018, 5:15 a.m. OK GNU C++11 TESTS 41 280 21094400 2300
43021783 neal E Sept. 18, 2018, 5:41 a.m. OK GNU C++14 TESTS 41 295 21299200 2300
43018544 neal E Sept. 18, 2018, 2:15 a.m. OK GNU C++14 TESTS 41 296 27340800 2300
43021812 neal E Sept. 18, 2018, 5:42 a.m. OK GNU C++14 TESTS 41 312 21299200 2300
43021222 neal E Sept. 18, 2018, 5:08 a.m. OK GNU C++14 TESTS 41 326 21094400 2300
44671764 kfqg E Oct. 21, 2018, 10:01 p.m. OK GNU C++14 TESTS 41 436 43724800 2300
57326874 yan-zp E July 19, 2019, 12:29 p.m. OK GNU C++14 TESTS 41 451 11980800 2300
44614742 kfqg E Oct. 20, 2018, 11:29 p.m. OK GNU C++14 TESTS 41 468 43724800 2300
43032786 erogame E Sept. 18, 2018, 12:26 p.m. OK GNU C++14 TESTS 41 499 18944000 2300
43628629 judgment E Oct. 1, 2018, 2:47 a.m. OK GNU C++14 TESTS 41 514 39014400 2300
42994427 nickluo E Sept. 17, 2018, 11:32 a.m. OK GNU C++14 TESTS 41 529 23142400 2300
45592243 F.J E Nov. 12, 2018, 1:14 p.m. OK GNU C++17 TESTS 41 296 16384000 2300
42990381 Roundgod E Sept. 17, 2018, 9:59 a.m. OK GNU C++17 TESTS 41 436 24268800 2300
43030722 yujinwunz E Sept. 18, 2018, 11:32 a.m. OK GNU C++17 TESTS 41 452 28876800 2300
43288140 bazsi700 E Sept. 23, 2018, 9:17 a.m. OK GNU C++17 TESTS 41 467 28057600 2300
50302150 aakk E Feb. 22, 2019, 3:14 a.m. OK GNU C++17 TESTS 41 468 28160000 2300
58823197 balbit E Aug. 14, 2019, 2:47 p.m. OK GNU C++17 TESTS 41 498 27033600 2300
50302119 vjudge2 E Feb. 22, 2019, 3:13 a.m. OK GNU C++17 TESTS 41 499 28160000 2300
43064529 fdironia E Sept. 19, 2018, 3:53 a.m. OK GNU C++17 TESTS 41 514 11980800 2300
47621249 aki167yuuki E Dec. 28, 2018, 12:54 p.m. OK GNU C++17 TESTS 41 514 31232000 2300
45471293 Koschei E Nov. 9, 2018, 9:50 a.m. OK GNU C++17 TESTS 41 529 27340800 2300
44053220 xodiac E Oct. 9, 2018, 8:38 p.m. OK Java 8 TESTS 41 889 158617600 2300
43474108 Ahmad E Sept. 27, 2018, 1:34 a.m. OK Java 8 TESTS 41 982 43212800 2300
44070256 daklqw E Oct. 10, 2018, 11:23 a.m. OK Java 8 TESTS 41 1263 33587200 2300
43551481 BiIIy E Sept. 29, 2018, 1:05 a.m. OK Java 8 TESTS 41 1325 122265600 2300
45699958 donli E Nov. 14, 2018, 7:24 a.m. OK Java 8 TESTS 41 1496 66252800 2300
43050276 chandan5284 E Sept. 18, 2018, 8:52 p.m. OK Java 8 TESTS 41 1793 147763200 2300
43474020 Ahmad E Sept. 27, 2018, 1:29 a.m. OK Java 8 TESTS 41 1934 43110400 2300
43001356 U_Square E Sept. 17, 2018, 1:58 p.m. OK Java 8 TESTS 41 1965 83148800 2300
57633464 Taran_1407 E July 24, 2019, 9:40 a.m. OK Java 8 TESTS 41 2043 54067200 2300
57603075 Taran_1407 E July 23, 2019, 4:40 p.m. OK Java 8 TESTS 41 2074 54067200 2300
43427292 markotee E Sept. 25, 2018, 9:16 p.m. OK Mono C# TESTS 41 1154 24166400 2300
43669689 vjudge5 E Oct. 2, 2018, 3:30 a.m. OK MS C++ TESTS 41 623 20070400 2300
52826193 c1729 E April 16, 2019, 1:49 p.m. OK PyPy 3 TESTS 41 904 36761600 2300
52825239 c1729 E April 16, 2019, 1:30 p.m. OK PyPy 3 TESTS 41 904 36761600 2300
52753432 pajenegod E April 14, 2019, 3:20 p.m. OK PyPy 3 TESTS 41 919 36761600 2300
52825474 c1729 E April 16, 2019, 1:34 p.m. OK PyPy 3 TESTS 41 935 36761600 2300
52725611 pajenegod E April 13, 2019, 11:52 p.m. OK PyPy 3 TESTS 41 1029 70246400 2300
52726197 pajenegod E April 14, 2019, 12:37 a.m. OK PyPy 3 TESTS 41 1044 70553600 2300
52726178 pajenegod E April 14, 2019, 12:35 a.m. OK PyPy 3 TESTS 41 1060 70246400 2300
52725642 pajenegod E April 13, 2019, 11:55 p.m. OK PyPy 3 TESTS 41 1076 69017600 2300
52725974 pajenegod E April 14, 2019, 12:21 a.m. OK PyPy 3 TESTS 41 1092 70246400 2300
52660627 c1729 E April 12, 2019, 10:30 p.m. OK PyPy 3 TESTS 41 1092 70451200 2300

remove filters

Back to search problems