Codeforces Round 954 (Div. 3)

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
1986 Codeforces Round 954 (Div. 3) FINISHED False 8100 18025763 June 23, 2024, 2:50 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 27251 ) B Matrix Stabilization PROGRAMMING brute force greedy sortings

B'You are given a matrix of size n x m , where the rows are numbered from 1 to n from top to bottom, and the columns are numbered from 1 to m from left to right. The element at the intersection of the i -th row and the j -th column is denoted by a_{ij} . Consider the algorithm for stabilizing matrix a : In this problem, cells (a, b) and (c, d) are considered neighbors if they share a common side, i.e., |a - c| + |b - d| = 1 . Your task is to output the matrix a after the stabilization algorithm has been executed. It can be shown that this algorithm cannot run for an infinite number of iterations. Each test consists of multiple sets of input data. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of sets of input data. This is followed by their description. The first line of each set of input data contains two integers n and m ( 1 <= q n, m <= q 100, n cdot m > 1 ) -- the number of rows and columns of matrix a . The next n lines describe the corresponding rows of the matrix. The i -th line contains m integers a_{i1}, a_{i2}, ldots, a_{im} ( 1 <= q a_{ij} <= q 10^9 ). It is guaranteed that the sum of n cdot m over all sets of input data does not exceed 2 cdot 10^5 . For each set of input data, output n lines with m numbers in each line -- the values of the cells of matrix a after the stabilization algorithm. In the first set of input data, the algorithm will select the cell (1, 1) twice in a row and then terminate. In the second set of input data, there is no cell whose value is strictly greater than the values of all neighboring cells. In the third set of input data, the algorithm will select the cell (2, 2) and then terminate. In the fourth set of input data, the algorithm will select the cell (1, 1) three times and then the cell (2, '...

Tutorials

130762

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
267098703 cipa B June 23, 2024, 8:18 p.m. OK C# 10 TESTS 4 249 3584000
267079074 Lianny04 B June 23, 2024, 5:10 p.m. OK C# 10 TESTS 4 280 3481600
267084163 TRR B June 23, 2024, 5:42 p.m. OK C++14 (GCC 6-32) TESTS 4 77 102400
267084306 Rifatbhuiyan B June 23, 2024, 5:43 p.m. OK C++14 (GCC 6-32) TESTS 4 78 0
267088715 acodebreaker B June 23, 2024, 6:20 p.m. OK C++14 (GCC 6-32) TESTS 4 92 0
267081165 Aya-Helal B June 23, 2024, 5:21 p.m. OK C++14 (GCC 6-32) TESTS 4 93 0
267083924 minhmengoc B June 23, 2024, 5:40 p.m. OK C++14 (GCC 6-32) TESTS 4 93 0
267083923 WyLx B June 23, 2024, 5:40 p.m. OK C++14 (GCC 6-32) TESTS 4 93 102400
267086973 Rasoul006 B June 23, 2024, 6:05 p.m. OK C++14 (GCC 6-32) TESTS 4 93 8089600
267083230 gaurav7376 B June 23, 2024, 5:35 p.m. OK C++14 (GCC 6-32) TESTS 4 108 0
267088342 meccav B June 23, 2024, 6:17 p.m. OK C++14 (GCC 6-32) TESTS 4 109 0
267091928 Manya6258 B June 23, 2024, 6:53 p.m. OK C++14 (GCC 6-32) TESTS 4 109 0
267079663 xiao_yuan B June 23, 2024, 5:12 p.m. OK C++17 (GCC 7-32) TESTS 4 62 0
267080243 emam_hasan_himu B June 23, 2024, 5:16 p.m. OK C++17 (GCC 7-32) TESTS 4 77 0
267079417 Sivam_Mohapatra B June 23, 2024, 5:11 p.m. OK C++17 (GCC 7-32) TESTS 4 77 0
267075281 theleywin B June 23, 2024, 5:01 p.m. OK C++17 (GCC 7-32) TESTS 4 78 0
267089827 harshn.work B June 23, 2024, 6:30 p.m. OK C++17 (GCC 7-32) TESTS 4 78 0
267088657 dphoenix3662 B June 23, 2024, 6:20 p.m. OK C++17 (GCC 7-32) TESTS 4 78 0
267087152 relatingCoder B June 23, 2024, 6:06 p.m. OK C++17 (GCC 7-32) TESTS 4 78 0
267087138 arel22 B June 23, 2024, 6:06 p.m. OK C++17 (GCC 7-32) TESTS 4 78 0
267085557 sam_heuer B June 23, 2024, 5:53 p.m. OK C++17 (GCC 7-32) TESTS 4 78 0
267094991 Fazle289 B June 23, 2024, 7:29 p.m. OK C++17 (GCC 7-32) TESTS 4 78 102400
267082656 AlexanderGarifullin B June 23, 2024, 5:30 p.m. OK C++20 (GCC 13-64) TESTS 4 61 0
267081515 suraj_gupta407 B June 23, 2024, 5:23 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
267092897 MohammedHossamW B June 23, 2024, 7:04 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
267091399 Janak217 B June 23, 2024, 6:47 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
267088648 alien_huntrr B June 23, 2024, 6:19 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
267087985 ali606 B June 23, 2024, 6:13 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
267087429 _Hyphen B June 23, 2024, 6:08 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
267085930 DedSecAlpha B June 23, 2024, 5:56 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
267082877 usama12 B June 23, 2024, 5:32 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
267081605 naghamrjoub B June 23, 2024, 5:24 p.m. OK C++20 (GCC 13-64) TESTS 4 62 0
267106791 bluemegane B June 23, 2024, 10:36 p.m. OK C# 8 TESTS 14 312 3481600
267076031 Fuad_Shahriar B June 23, 2024, 5:02 p.m. OK GNU C11 TESTS 4 796 0
267075514 chinmaybajod149 B June 23, 2024, 5:01 p.m. OK GNU C11 TESTS 4 796 102400
267095378 2205103 B June 23, 2024, 7:34 p.m. OK GNU C11 TESTS 4 796 204800
267084087 himansugupta43 B June 23, 2024, 5:41 p.m. OK GNU C11 TESTS 4 811 0
267095651 theshadman007 B June 23, 2024, 7:37 p.m. OK GNU C11 TESTS 4 811 102400
267094889 2205103 B June 23, 2024, 7:28 p.m. OK GNU C11 TESTS 4 858 307200
267113814 IEluan B June 24, 2024, 1:22 a.m. OK GNU C11 TESTS 14 1499 204800
267110628 aza161 B June 24, 2024, 12:07 a.m. OK GNU C11 TESTS 14 1531 102400
267103748 crapcode B June 23, 2024, 9:38 p.m. OK GNU C11 TESTS 14 1562 204800
267110341 aza161 B June 23, 2024, 11:59 p.m. OK GNU C11 TESTS 14 1639 204800
267076860 Buri__Buri B June 23, 2024, 5:03 p.m. OK Go TESTS 4 109 9216000
267085742 1936557 B June 23, 2024, 5:55 p.m. OK Haskell TESTS 4 171 1024000
267127134 Mg718 B June 24, 2024, 4:47 a.m. OK Java 21 TESTS 14 296 1945600
267100946 Pv2f4n B June 23, 2024, 8:51 p.m. OK Java 21 TESTS 14 343 512000
267116640 e-z B June 24, 2024, 2:19 a.m. OK Java 21 TESTS 14 374 1126400
267127903 Romanual B June 24, 2024, 4:57 a.m. OK Java 21 TESTS 14 452 1433600
267092244 Rishabh_Coder2003 B June 23, 2024, 6:57 p.m. OK Java 21 TESTS 4 780 1536000
267117858 goalboy B June 24, 2024, 2:40 a.m. OK Java 21 TESTS 14 781 1536000
267086071 gsahijwani B June 23, 2024, 5:57 p.m. OK Java 21 TESTS 4 796 2150400
267081617 sharmashirish8500 B June 23, 2024, 5:24 p.m. OK Java 21 TESTS 4 811 1024000
267091269 roydurgesh B June 23, 2024, 6:46 p.m. OK Java 21 TESTS 4 811 1228800
267078976 jontybot B June 23, 2024, 5:09 p.m. OK Java 21 TESTS 4 827 716800
267087748 Jay08 B June 23, 2024, 6:11 p.m. OK Java 8 TESTS 4 187 39116800
267090091 payal_2001 B June 23, 2024, 6:33 p.m. OK Java 8 TESTS 4 217 0
267108916 MarPal B June 23, 2024, 11:24 p.m. OK Java 8 TESTS 14 218 0
267086556 2manas1 B June 23, 2024, 6:01 p.m. OK Java 8 TESTS 4 437 0
267094524 mr___hacker____ B June 23, 2024, 7:24 p.m. OK Java 8 TESTS 4 452 0
267094753 mohamedwaleid811 B June 23, 2024, 7:26 p.m. OK Java 8 TESTS 4 624 0
267093443 krishnajeena B June 23, 2024, 7:11 p.m. OK Java 8 TESTS 4 640 0
267080106 hiteshbhatiya787 B June 23, 2024, 5:15 p.m. OK Java 8 TESTS 4 656 0
267084230 ankitgupta860 B June 23, 2024, 5:42 p.m. OK Java 8 TESTS 4 671 0
267075186 CNelite B June 23, 2024, 5:01 p.m. OK Java 8 TESTS 4 702 0
267096252 kshitij__18 B June 23, 2024, 7:45 p.m. OK Node.js TESTS 4 296 16179200
267080758 co23btech11003 B June 23, 2024, 5:19 p.m. OK PyPy 3 TESTS 4 406 10444800
267096321 coder_11 B June 23, 2024, 7:46 p.m. OK PyPy 3 TESTS 4 421 10752000
267092609 taliansky B June 23, 2024, 7:01 p.m. OK PyPy 3 TESTS 4 452 10854400
267080741 ghoshashis545 B June 23, 2024, 5:18 p.m. OK PyPy 3 TESTS 4 718 11264000
267103239 rashadalsharpini B June 23, 2024, 9:29 p.m. OK PyPy 3 TESTS 14 1171 10854400
267110472 KingofCSES B June 24, 2024, 12:02 a.m. OK PyPy 3 TESTS 14 1218 10956800
267087821 pusheen_1024 B June 23, 2024, 6:12 p.m. OK PyPy 3-64 TESTS 4 156 6758400
267099442 AndreiZherder B June 23, 2024, 8:28 p.m. OK PyPy 3-64 TESTS 4 186 7884800
267086052 InHng_ B June 23, 2024, 5:57 p.m. OK PyPy 3-64 TESTS 4 202 9523200
267093954 sohampalkar B June 23, 2024, 7:17 p.m. OK PyPy 3-64 TESTS 4 218 10035200
267097497 singh.eureka B June 23, 2024, 8:02 p.m. OK PyPy 3-64 TESTS 4 218 10342400
267129816 jiangjinjinyxt B June 24, 2024, 5:22 a.m. OK PyPy 3-64 TESTS 14 218 12595200
267090813 Om_Singh_ B June 23, 2024, 6:40 p.m. OK PyPy 3-64 TESTS 4 233 8704000
267115886 InHng B June 24, 2024, 2:05 a.m. OK PyPy 3-64 TESTS 14 233 10137600
267106997 NitroSpear B June 23, 2024, 10:40 p.m. OK PyPy 3-64 TESTS 14 233 10240000
267113738 katonyonko B June 24, 2024, 1:20 a.m. OK PyPy 3-64 TESTS 14 234 10035200
267085115 olveng B June 23, 2024, 5:50 p.m. OK Python 3 TESTS 4 265 5427200
267086338 CodeArmy B June 23, 2024, 5:59 p.m. OK Python 3 TESTS 4 390 614400
267077782 divya_madhuri B June 23, 2024, 5:04 p.m. OK Python 3 TESTS 4 452 14131200
267075664 Anna_Sh B June 23, 2024, 5:02 p.m. OK Python 3 TESTS 4 530 716800
267080634 ArfatBhatti B June 23, 2024, 5:18 p.m. OK Python 3 TESTS 4 531 204800
267089517 neel_Patel_02 B June 23, 2024, 6:27 p.m. OK Python 3 TESTS 4 531 716800
267078708 yoniti B June 23, 2024, 5:08 p.m. OK Python 3 TESTS 4 561 409600
267119614 minussix B June 24, 2024, 3:09 a.m. OK Python 3 TESTS 14 608 409600
267088832 sri_jaahn B June 23, 2024, 6:21 p.m. OK Python 3 TESTS 4 624 409600
267103474 Rujul B June 23, 2024, 9:33 p.m. OK Python 3 TESTS 14 655 819200
267090246 0x81 B June 23, 2024, 6:35 p.m. OK Ruby 3 TESTS 4 639 3891200
267090950 0x81 B June 23, 2024, 6:41 p.m. OK Ruby 3 TESTS 4 1406 4608000
267120437 ElectronApps B June 24, 2024, 3:22 a.m. OK Rust 2021 TESTS 14 437 0

remove filters

Back to search problems