Codeforces Round 775 (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
1648 Codeforces Round 775 (Div. 1, based on Moscow Open Olympiad in Informatics) FINISHED False 8100 90705863 March 6, 2022, 9:55 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13560 ) A Weird Sum PROGRAMMING combinatorics data structures geometry math matrices sortings

B'Egor has a table of size n x m , with lines numbered from 1 to n and columns numbered from 1 to m . Each cell has a color that can be presented as an integer from 1 to 10^5 . Let us denote the cell that lies in the intersection of the r -th row and the c -th column as (r, c) . We define the manhattan distance between two cells (r_1, c_1) and (r_2, c_2) as the length of a shortest path between them where each consecutive cells in the path must have a common side. The path can go through cells of any color. For example, in the table 3 x 4 the manhattan distance between (1, 2) and (3, 3) is 3 , one of the shortest paths is the following: (1, 2) to (2, 2) to (2, 3) to (3, 3) . Egor decided to calculate the sum of manhattan distances between each pair of cells of the same color. Help him to calculate this sum. The first line contains two integers n and m ( 1 <= q n <= m , n cdot m <= q 100 ,000 ) -- number of rows and columns in the table. Each of next n lines describes a row of the table. The i -th line contains m integers c_{i1}, c_{i2}, ldots, c_{im} ( 1 <= c_{ij} <= 100 ,000 ) -- colors of cells in the i -th row. Print one integer -- the the sum of manhattan distances between each pair of cells of the same color. In the first sample there are three pairs of cells of same color: in cells (1, 1) and (2, 3) , in cells (1, 2) and (2, 2) , in cells (1, 3) and (2, 1) . The manhattan distances between them are 3 , 1 and 3 , the sum is 7 . '...

Tutorials

Codeforces Round #775 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
148659730 buckley A March 7, 2022, 4:20 a.m. OK GNU C++14 TESTS 65 31 1740800
148627024 no_one_ A March 6, 2022, 4:21 p.m. OK GNU C++14 TESTS 65 31 2048000
148549607 crazy_sea A March 6, 2022, 10:06 a.m. OK GNU C++14 TESTS 65 31 2355200
148546777 gzchenben A March 6, 2022, 10:03 a.m. OK GNU C++14 TESTS 65 31 2457600
148542810 lucaperju A March 6, 2022, 9:59 a.m. OK GNU C++14 TESTS 65 31 3276800
148543871 applese A March 6, 2022, 10 a.m. OK GNU C++14 TESTS 65 31 3686400
148547849 fengqiyuka A March 6, 2022, 10:04 a.m. OK GNU C++14 TESTS 65 46 1228800
148544232 ugly2333 A March 6, 2022, 10:01 a.m. OK GNU C++14 TESTS 65 46 1843200
148542797 crashed A March 6, 2022, 9:59 a.m. OK GNU C++14 TESTS 65 46 1945600
148549936 ljc1301 A March 6, 2022, 10:07 a.m. OK GNU C++14 TESTS 65 46 2048000
148542715 abc864197532 A March 6, 2022, 9:59 a.m. OK GNU C++17 TESTS 65 31 2457600
148654770 shndjm A March 7, 2022, 2:11 a.m. OK GNU C++17 TESTS 65 31 3174400
148555861 Gowill_Yellow A March 6, 2022, 10:14 a.m. OK GNU C++17 TESTS 65 31 4812800
148547058 ZZTC2000731 A March 6, 2022, 10:03 a.m. OK GNU C++17 TESTS 65 31 5734400
148657094 northbank A March 7, 2022, 3:16 a.m. OK GNU C++17 TESTS 65 46 1228800
148547526 TeaPot A March 6, 2022, 10:04 a.m. OK GNU C++17 TESTS 65 46 1638400
148626543 __riya_sharma__ A March 6, 2022, 4:15 p.m. OK GNU C++17 TESTS 65 46 1638400
148545584 MonkeyKing A March 6, 2022, 10:02 a.m. OK GNU C++17 TESTS 65 46 2048000
148551569 ympc2005 A March 6, 2022, 10:08 a.m. OK GNU C++17 TESTS 65 46 2457600
148549026 farmerboy A March 6, 2022, 10:06 a.m. OK GNU C++17 TESTS 65 46 2457600
148558960 Bungmint A March 6, 2022, 10:19 a.m. OK GNU C++17 (64) TESTS 65 30 7987200
148553265 RiCHEPCPR A March 6, 2022, 10:11 a.m. OK GNU C++17 (64) TESTS 65 30 30310400
148543706 natsugiri A March 6, 2022, 10 a.m. OK GNU C++17 (64) TESTS 65 31 2048000
148546906 ChthollyNotaSeniorious A March 6, 2022, 10:03 a.m. OK GNU C++17 (64) TESTS 65 31 2048000
148543237 skip2004 A March 6, 2022, 10 a.m. OK GNU C++17 (64) TESTS 65 31 2048000
148567840 KKT_89 A March 6, 2022, 10:35 a.m. OK GNU C++17 (64) TESTS 65 31 2457600
148545317 EasonTAO A March 6, 2022, 10:02 a.m. OK GNU C++17 (64) TESTS 65 31 2662400
148544072 Lain A March 6, 2022, 10 a.m. OK GNU C++17 (64) TESTS 65 31 3174400
148560118 yatuba A March 6, 2022, 10:21 a.m. OK GNU C++17 (64) TESTS 65 31 3174400
148543978 balbit A March 6, 2022, 10 a.m. OK GNU C++17 (64) TESTS 65 31 3174400
148545081 hanguandong A March 6, 2022, 10:01 a.m. OK GNU C++20 (64) TESTS 65 31 1740800
148549712 keywet06 A March 6, 2022, 10:06 a.m. OK GNU C++20 (64) TESTS 65 31 2457600
148651299 Alan233 A March 7, 2022, 12:06 a.m. OK GNU C++20 (64) TESTS 65 31 2764800
148605672 Fysty A March 6, 2022, 12:58 p.m. OK GNU C++20 (64) TESTS 65 31 3276800
148542062 353cerega A March 6, 2022, 9:58 a.m. OK GNU C++20 (64) TESTS 65 31 3379200
148553187 gvihvo A March 6, 2022, 10:10 a.m. OK GNU C++20 (64) TESTS 65 31 3993600
148631775 MisterGu A March 6, 2022, 5:23 p.m. OK GNU C++20 (64) TESTS 65 31 3993600
148545657 .Mahdi. A March 6, 2022, 10:02 a.m. OK GNU C++20 (64) TESTS 65 31 4198400
148542147 kmjp A March 6, 2022, 9:58 a.m. OK GNU C++20 (64) TESTS 65 31 4608000
148658604 abhidot A March 7, 2022, 3:53 a.m. OK GNU C++20 (64) TESTS 65 31 4812800
148544544 mmaxio A March 6, 2022, 10:01 a.m. OK Java 11 TESTS 65 202 0
148544093 uwi A March 6, 2022, 10 a.m. OK Java 11 TESTS 65 265 0
148548002 YahiaSherif A March 6, 2022, 10:05 a.m. OK Java 11 TESTS 65 342 18739200
148547907 procrastinate7 A March 6, 2022, 10:04 a.m. OK Java 11 TESTS 65 342 18739200
148613596 watarimaycry2 A March 6, 2022, 1:57 p.m. OK Java 11 TESTS 65 389 33382400
148546355 Cepera A March 6, 2022, 10:03 a.m. OK Java 11 TESTS 65 483 38092800
148649849 NatInTheHat A March 6, 2022, 11:01 p.m. OK Java 8 TESTS 65 140 1945600
148663005 govindrajput A March 7, 2022, 5:26 a.m. OK Java 8 TESTS 65 421 47206400
148608590 arvindf232 A March 6, 2022, 1:17 p.m. OK Kotlin 1.4 TESTS 65 155 614400
148544465 Sparky_Master_WCH1226 A March 6, 2022, 10:01 a.m. OK Kotlin 1.4 TESTS 65 155 614400
148554890 Hakiobo A March 6, 2022, 10:13 a.m. OK Kotlin 1.4 TESTS 65 327 6348800
148544654 machine_solution A March 6, 2022, 10:01 a.m. OK MS C++ 2017 TESTS 65 202 9113600
148549962 mban259 A March 6, 2022, 10:07 a.m. OK .NET Core C# TESTS 65 155 20070400
148635366 eepsilon A March 6, 2022, 6:11 p.m. OK PyPy 3 TESTS 65 155 11468800
148546178 lowking A March 6, 2022, 10:02 a.m. OK PyPy 3 TESTS 65 249 24166400
148542650 toam A March 6, 2022, 9:59 a.m. OK PyPy 3 TESTS 65 264 25088000
148556325 suncup224 A March 6, 2022, 10:15 a.m. OK PyPy 3 TESTS 65 295 23552000
148547954 akhan42 A March 6, 2022, 10:04 a.m. OK PyPy 3 TESTS 65 311 27955200
148545591 hir35 A March 6, 2022, 10:02 a.m. OK PyPy 3-64 TESTS 65 187 18124800
148549108 googol_S0 A March 6, 2022, 10:06 a.m. OK PyPy 3-64 TESTS 65 202 20889600
148660538 mnkp A March 7, 2022, 4:39 a.m. OK PyPy 3-64 TESTS 65 233 40038400
148547253 tamato A March 6, 2022, 10:04 a.m. OK PyPy 3-64 TESTS 65 264 25190400
148549236 lucifer1004 A March 6, 2022, 10:06 a.m. OK PyPy 3-64 TESTS 65 280 28262400
148549696 justinz2018 A March 6, 2022, 10:06 a.m. OK PyPy 3-64 TESTS 65 280 33894400
148544681 mees A March 6, 2022, 10:01 a.m. OK PyPy 3-64 TESTS 65 295 40243200
148655299 yumtam A March 7, 2022, 2:27 a.m. OK PyPy 3-64 TESTS 65 436 52224000
148659500 nicku123 A March 7, 2022, 4:14 a.m. OK PyPy 3-64 TESTS 65 467 44851200
148548663 r57shell A March 6, 2022, 10:05 a.m. OK Python 3 TESTS 65 296 22732800
148615717 sansen A March 6, 2022, 2:16 p.m. OK Rust 2021 TESTS 65 62 15564800
148551070 Egor A March 6, 2022, 10:08 a.m. OK Rust 2021 TESTS 65 77 16896000

remove filters

Back to search problems