Order Capital Round 1 (Codeforces Round 1038, Div. 1 + 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
2122 Order Capital Round 1 (Codeforces Round 1038, Div. 1 + Div. 2) FINISHED False 8100 23469923 July 19, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 19144 ) A Greedy Grid PROGRAMMING constructive algorithms greedy

A path in a grid is called greedy if it starts at the top-left cell and moves only to the right or downward, always moving to its neighbor with the greater value (or either if the values are equal). The value of a path is the sum of the values of the cells it visits, including the start and end. Does there exist an (n \times m) grid of nonnegative integers such that no greedy path achieves the maximum value among all down/right paths? Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 5000)). The description of the test cases follows. The only line of each test case contains two integers (n), (m) ((1 \leq n, m \leq 100)) — the number of rows and columns in the grid, respectively. For each test case, on a separate line output " YES " if the required grid exists, and " NO " otherwise. You can output the answer in any case (upper or lower). For example, the strings " yEs ", " yes ", " Yes ", and " YES " will be recognized as positive responses. In the first test case, an example of a grid in which no greedy path achieves the maximum value out of all down/right paths is: () \begin{bmatrix} 3 & 5 & 1 \\ 2 & 1 & 2 \\ 5 & 4 & 3 \\ \end{bmatrix} () Let (a_{i, j}) denote the value of the cell in the (i)-th row and (j)-th column. The maximum value of a down/right path is (a_{1,1} + a_{2,1} + a_{3,1} + a_{3,2} + a_{3,3} = 17). This path isn't greedy because (a_{1,2}) is greater than (a_{2,1}); thus, a greedy path must move right in the first step. The maximum value of a greedy path is (a_{1,1} + a_{1,2} + a_{2,2} + a_{3,2} + a_{3,3} = 16). In the second test case, it can be proven that no grid satisfies the conditions.

Tutorials

Order Capital Round 1 (Codeforces Round 1038, Div. 1 + Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
329916505 shanshan12356 A July 20, 2025, 2:41 a.m. OK C++17 (GCC 7-32) TESTS 3 15 0
329913564 goldener A July 20, 2025, 1:42 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
329895358 BitScarlett A July 19, 2025, 7:22 p.m. OK C++17 (GCC 7-32) TESTS 3 30 0
329892565 anshgutpa326 A July 19, 2025, 6:50 p.m. OK C++17 (GCC 7-32) TESTS 3 30 0
329891018 ZePhYeR_ A July 19, 2025, 6:35 p.m. OK C++17 (GCC 7-32) TESTS 3 30 0
329885534 P__hi A July 19, 2025, 5:49 p.m. OK C++17 (GCC 7-32) TESTS 3 30 0
329924393 slzxpanhongxuan A July 20, 2025, 4:51 a.m. OK C++17 (GCC 7-32) TESTS 3 30 0
329925919 A1mless A July 20, 2025, 5:12 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
329925945 vivekjd_9 A July 20, 2025, 5:13 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
329922912 harsh_sah A July 20, 2025, 4:26 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
329924644 August61945 A July 20, 2025, 4:55 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
329923532 Bazinga_2004 A July 20, 2025, 4:36 a.m. OK C++20 (GCC 13-64) TESTS 3 30 0
329888250 Notheamit A July 19, 2025, 6:11 p.m. OK C++20 (GCC 13-64) TESTS 3 30 0
329927086 TheLastHutu A July 20, 2025, 5:28 a.m. OK C++20 (GCC 13-64) TESTS 3 30 102400
329924873 Hare-053 A July 20, 2025, 4:58 a.m. OK C++20 (GCC 13-64) TESTS 3 30 102400
329923263 NoobMaster069 A July 20, 2025, 4:31 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
329922139 0rsted A July 20, 2025, 4:13 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
329918728 hpesoj A July 20, 2025, 3:20 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
329915782 RushGul A July 20, 2025, 2:28 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
329915774 shetty_07 A July 20, 2025, 2:28 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
329890016 mfaiz_1 A July 19, 2025, 6:25 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329929650 Aurora_xz A July 20, 2025, 5:57 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329928126 Song4u A July 20, 2025, 5:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329925523 ArpitKSi A July 20, 2025, 5:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329917592 call_me_sharma A July 20, 2025, 3 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329913668 yuexiabanye A July 20, 2025, 1:44 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329902053 Yus1f_M A July 19, 2025, 8:55 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329896094 Hbayeb A July 19, 2025, 7:31 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329890403 m_conq A July 19, 2025, 6:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329889251 mvr_ A July 19, 2025, 6:19 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
329911324 yasigma A July 20, 2025, 12:41 a.m. OK GNU C11 TESTS 3 31 102400
329869790 _.eyewhy._ A July 19, 2025, 4:30 p.m. OK GNU C11 TESTS 3 77 102400
329868138 limon162 A July 19, 2025, 4:26 p.m. OK GNU C11 TESTS 3 77 102400
329867768 Sayantan_Hazra A July 19, 2025, 4:26 p.m. OK GNU C11 TESTS 3 77 102400
329882232 Eremite_404 A July 19, 2025, 5:26 p.m. OK GNU C11 TESTS 3 93 0
329918072 FurudeRika A July 20, 2025, 3:08 a.m. OK Go TESTS 3 46 307200
329871541 zeusss25 A July 19, 2025, 4:35 p.m. OK Java 21 TESTS 3 202 102400
329890705 swatishivam23 A July 19, 2025, 6:32 p.m. OK Java 21 TESTS 3 217 204800
329882574 me_shivendra01 A July 19, 2025, 5:29 p.m. OK Java 21 TESTS 3 218 0
329898379 Prantik_ A July 19, 2025, 8 p.m. OK Java 21 TESTS 3 218 307200
329907208 hategreedy A July 19, 2025, 10:19 p.m. OK Java 21 TESTS 3 218 512000
329882182 bhargav.cf A July 19, 2025, 5:26 p.m. OK Java 21 TESTS 3 218 921600
329906991 dwoolley3 A July 19, 2025, 10:13 p.m. OK Java 21 TESTS 3 218 1024000
329925026 goalboy A July 20, 2025, 5 a.m. OK Java 21 TESTS 3 233 307200
329925737 0808Dubey A July 20, 2025, 5:10 a.m. OK Java 21 TESTS 3 233 1126400
329903234 mzip A July 19, 2025, 9:16 p.m. OK Java 21 TESTS 3 234 614400
329891878 Trouble_shooter A July 19, 2025, 6:43 p.m. OK Java 8 TESTS 3 124 0
329929439 Pranav_45 A July 20, 2025, 5:55 a.m. OK Java 8 TESTS 3 124 39014400
329884473 2manas1 A July 19, 2025, 5:41 p.m. OK Java 8 TESTS 3 156 0
329875855 Bidhan1811 A July 19, 2025, 4:44 p.m. OK Java 8 TESTS 3 186 0
329875182 harshmakwana2706 A July 19, 2025, 4:43 p.m. OK Java 8 TESTS 3 187 0
329901062 pranav__muj A July 19, 2025, 8:39 p.m. OK Java 8 TESTS 3 202 0
329887964 Adarsh_ch7 A July 19, 2025, 6:08 p.m. OK Java 8 TESTS 3 218 0
329875605 Dev_Patel9906 A July 19, 2025, 4:44 p.m. OK Java 8 TESTS 3 218 0
329892606 MA_TT A July 19, 2025, 6:50 p.m. OK PyPy 3 TESTS 3 187 4915200
329888749 tomchikponchik A July 19, 2025, 6:15 p.m. OK PyPy 3-64 TESTS 3 92 2150400
329920082 dyzhang A July 20, 2025, 3:40 a.m. OK PyPy 3-64 TESTS 3 93 2355200
329869245 GRIDFALL___ A July 19, 2025, 4:29 p.m. OK PyPy 3-64 TESTS 3 93 2457600
329924314 jvatsal0709 A July 20, 2025, 4:49 a.m. OK PyPy 3-64 TESTS 3 93 2969600
329881354 ajayvarmak5 A July 19, 2025, 5:21 p.m. OK PyPy 3-64 TESTS 3 108 2457600
329895896 ok-sana-inf A July 19, 2025, 7:29 p.m. OK PyPy 3-64 TESTS 3 108 2867200
329885061 HaisTous A July 19, 2025, 5:46 p.m. OK PyPy 3-64 TESTS 3 108 3686400
329906030 SharadenduDwiv A July 19, 2025, 9:52 p.m. OK PyPy 3-64 TESTS 3 109 2867200
329929172 bhuvan_sankar_gupta A July 20, 2025, 5:52 a.m. OK PyPy 3-64 TESTS 3 109 3174400
329882150 kimabi A July 19, 2025, 5:26 p.m. OK PyPy 3-64 TESTS 3 109 3174400
329887103 MACLOVER A July 19, 2025, 6:01 p.m. OK Python 3 TESTS 3 62 0
329875046 _suyash_ A July 19, 2025, 4:43 p.m. OK Python 3 TESTS 3 62 307200
329929388 RifterSir A July 20, 2025, 5:54 a.m. OK Python 3 TESTS 3 77 0
329871140 lightningskipper A July 19, 2025, 4:34 p.m. OK Python 3 TESTS 3 77 0
329870057 techwizrv A July 19, 2025, 4:31 p.m. OK Python 3 TESTS 3 77 0
329930060 lameee A July 20, 2025, 6:02 a.m. OK Python 3 TESTS 3 77 204800
329927950 dong0625 A July 20, 2025, 5:38 a.m. OK Python 3 TESTS 3 77 204800
329907537 yeerenchen A July 19, 2025, 10:30 p.m. OK Python 3 TESTS 3 77 204800
329903062 aghadge91 A July 19, 2025, 9:13 p.m. OK Python 3 TESTS 3 77 204800
329901486 s1ddhesh A July 19, 2025, 8:46 p.m. OK Python 3 TESTS 3 77 204800
329926164 omishere21 A July 20, 2025, 5:16 a.m. OK Rust 2021 TESTS 3 46 0
329888480 Martician A July 19, 2025, 6:13 p.m. OK Rust 2021 TESTS 3 46 0
329912935 silicalet A July 20, 2025, 1:25 a.m. OK Rust 2021 TESTS 3 61 0

remove filters

Back to search problems