Neowise Labs Contest 1 (Codeforces Round 1018, 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
2096 Neowise Labs Contest 1 (Codeforces Round 1018, Div. 1 + Div. 2) FINISHED False 7200 31332323 April 19, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 8166 ) C Wonderful City PROGRAMMING dp implementation

You are the proud leader of a city in Ancient Berland. There are (n^2) buildings arranged in a grid of (n) rows and (n) columns. The height of the building in row (i) and column (j) is (h_{i, j}). The city is beautiful if no two adjacent by side buildings have the same height. In other words, it must satisfy the following: There does not exist a position ((i, j)) ((1 \leq i \leq n), (1 \leq j \leq n - 1)) such that (h_{i, j} = h_{i, j + 1}). There does not exist a position ((i, j)) ((1 \leq i \leq n - 1), (1 \leq j \leq n)) such that (h_{i, j} = h_{i + 1, j}). There are (n) workers at company A, and (n) workers at company B. Each worker can be hired at most once . It costs (a_i) coins to hire worker (i) at company A. After hiring, worker (i) will: Increase the heights of all buildings in row (i) by (1). In other words, increase (h_{i, 1}, h_{i, 2}, \ldots, h_{i, n}) by (1). It costs (b_j) coins to hire worker (j) at company B. After hiring, worker (j) will: Increase the heights of all buildings in column (j) by (1). In other words, increase (h_{1, j}, h_{2, j}, \ldots, h_{n, j}) by (1). Find the minimum number of coins needed to make the city beautiful, or report that it is impossible. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((2 \le n \le 1000)) — the size of the grid. The (i)-th of the next (n) lines of each test case contains (n) integers (h_{i, 1}, h_{i, 2}, \ldots, h_{i, n}) ((1 \le h_{i, j} \le 10^9)) — the heights of the buildings in row (i). The next line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le 10^9)) — the costs of hiring the workers at company A. The next line of

Tutorials

Neowise Labs Contest 1 (Codeforces Round 1018, 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
316295008 og.kostya C April 19, 2025, 5:36 p.m. OK C# 10 TESTS 19 140 7884800
316279966 ok12 C April 19, 2025, 4:08 p.m. OK C# 10 TESTS 19 187 11366400
316283706 vineel03 C April 19, 2025, 4:20 p.m. OK C# 10 TESTS 19 218 9728000
316273810 mban259 C April 19, 2025, 3:50 p.m. OK C# 10 TESTS 19 264 11161600
316284050 MegaRayquaza C April 19, 2025, 4:21 p.m. OK C# 10 TESTS 19 281 9728000
316338497 SakshamSaldhi123 C April 20, 2025, 5:57 a.m. OK C++17 (GCC 7-32) TESTS 19 249 409600
316332190 Aiyaari C April 20, 2025, 4:29 a.m. OK C++17 (GCC 7-32) TESTS 19 249 409600
316332028 Aiyaari C April 20, 2025, 4:26 a.m. OK C++17 (GCC 7-32) TESTS 19 249 409600
316331516 inside_i_am_more C April 20, 2025, 4:18 a.m. OK C++17 (GCC 7-32) TESTS 19 249 409600
316319704 mango_lassi C April 19, 2025, 11:38 p.m. OK C++17 (GCC 7-32) TESTS 19 249 409600
316310107 Fuadbey C April 19, 2025, 8:18 p.m. OK C++17 (GCC 7-32) TESTS 19 249 409600
316309931 TesTing_Sol C April 19, 2025, 8:16 p.m. OK C++17 (GCC 7-32) TESTS 19 249 409600
316287697 W0LVeRiNE C April 19, 2025, 4:31 p.m. OK C++17 (GCC 7-32) TESTS 19 249 512000
316276946 Alan_Choque C April 19, 2025, 3:59 p.m. OK C++17 (GCC 7-32) TESTS 19 249 512000
316282937 adityacosmos24 C April 19, 2025, 4:17 p.m. OK C++17 (GCC 7-32) TESTS 19 249 614400
316334444 pheonix_2002 C April 20, 2025, 5:06 a.m. OK C++20 (GCC 13-64) TESTS 19 186 716800
316332506 ali2005_syr C April 20, 2025, 4:35 a.m. OK C++20 (GCC 13-64) TESTS 19 187 409600
316314476 vitosevski C April 19, 2025, 9:24 p.m. OK C++20 (GCC 13-64) TESTS 19 187 409600
316279382 SherLocked25 C April 19, 2025, 4:06 p.m. OK C++20 (GCC 13-64) TESTS 19 187 716800
316276970 Void_Wu C April 19, 2025, 3:59 p.m. OK C++20 (GCC 13-64) TESTS 19 187 819200
316322087 caoshurui C April 20, 2025, 12:55 a.m. OK C++20 (GCC 13-64) TESTS 19 187 4096000
316324288 Redial C April 20, 2025, 1:52 a.m. OK C++20 (GCC 13-64) TESTS 19 187 4198400
316287606 yingling C April 19, 2025, 4:31 p.m. OK C++20 (GCC 13-64) TESTS 19 187 5120000
316334807 Brovko C April 20, 2025, 5:11 a.m. OK C++20 (GCC 13-64) TESTS 19 202 409600
316284166 MahD C April 19, 2025, 4:21 p.m. OK C++20 (GCC 13-64) TESTS 19 202 512000
316282413 424479543 C April 19, 2025, 4:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 19 171 921600
316321754 Meeperbunny C April 20, 2025, 12:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 187 819200
316282247 shdut0901 C April 19, 2025, 4:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 19 187 819200
316278694 Sirius_A C April 19, 2025, 4:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 19 187 819200
316273503 ty09 C April 19, 2025, 3:49 p.m. OK C++23 (GCC 14-64, msys2) TESTS 19 187 819200
316302734 ll931110 C April 19, 2025, 6:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 19 187 4096000
316281388 kakoujt C April 19, 2025, 4:13 p.m. OK C++23 (GCC 14-64, msys2) TESTS 19 202 409600
316337178 Dongchy666 C April 20, 2025, 5:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 202 819200
316336891 wWwWw233 C April 20, 2025, 5:37 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 202 819200
316328317 MatinalCosmos C April 20, 2025, 3:17 a.m. OK C++23 (GCC 14-64, msys2) TESTS 19 202 819200
316273625 cyclop5 C April 19, 2025, 3:49 p.m. OK Go TESTS 19 265 27545600
316331798 flyinggit C April 20, 2025, 4:23 a.m. OK Haskell TESTS 19 843 80896000
316276027 Dg10 C April 19, 2025, 3:56 p.m. OK Java 21 TESTS 19 312 6860800
316272970 waleedul C April 19, 2025, 3:48 p.m. OK Java 21 TESTS 19 514 6963200
316284117 ysahu C April 19, 2025, 4:21 p.m. OK Java 21 TESTS 19 515 819200
316278867 anay293 C April 19, 2025, 4:05 p.m. OK Java 21 TESTS 19 515 921600
316279253 krishnamoorthy C April 19, 2025, 4:06 p.m. OK Java 21 TESTS 19 515 7270400
316299997 Balu2907 C April 19, 2025, 6:21 p.m. OK Java 21 TESTS 19 515 7884800
316280235 Yuki_B C April 19, 2025, 4:09 p.m. OK Java 21 TESTS 19 531 819200
316313537 jerdno C April 19, 2025, 9:07 p.m. OK Java 21 TESTS 19 531 1843200
316273266 Hastorius C April 19, 2025, 3:48 p.m. OK Java 21 TESTS 19 531 1945600
316286976 Archith1 C April 19, 2025, 4:29 p.m. OK Java 21 TESTS 19 546 614400
316335508 sf14t C April 20, 2025, 5:20 a.m. OK Java 8 TESTS 19 218 17612800
316278662 cai_lian_2023 C April 19, 2025, 4:04 p.m. OK Java 8 TESTS 19 421 0
316273303 guptashreyansh2048 C April 19, 2025, 3:49 p.m. OK Java 8 TESTS 19 453 0
316297362 ppwani C April 19, 2025, 5:56 p.m. OK Java 8 TESTS 19 468 21504000
316291618 SilverBullet4869 C April 19, 2025, 5:12 p.m. OK Java 8 TESTS 19 1546 0
316280899 bt22cse036 C April 19, 2025, 4:11 p.m. OK Java 8 TESTS 19 1561 0
316327515 kingcabrams C April 20, 2025, 3:02 a.m. OK Kotlin 1.9 TESTS 19 233 0
316315467 calmtrout C April 19, 2025, 9:43 p.m. OK Kotlin 1.9 TESTS 19 952 32768000
316298164 jagbarrameda C April 19, 2025, 6:04 p.m. OK Kotlin 1.9 TESTS 19 1140 65126400
316279976 ZRnQ C April 19, 2025, 4:08 p.m. OK Kotlin 1.9 TESTS 19 1593 0
316301003 ahtoh_ C April 19, 2025, 6:30 p.m. OK Node.js TESTS 19 328 52531200
316272506 adriandabeast C April 19, 2025, 3:46 p.m. OK PyPy 3 TESTS 19 1077 11468800
316319665 SnowballSH C April 19, 2025, 11:36 p.m. OK PyPy 3 TESTS 19 1171 11264000
316276751 xuyhhh C April 19, 2025, 3:58 p.m. OK PyPy 3 TESTS 19 1202 11673600
316276763 nazeeftham007 C April 19, 2025, 3:59 p.m. OK PyPy 3 TESTS 19 1343 14950400
316284248 CHelle C April 19, 2025, 4:21 p.m. OK PyPy 3-64 TESTS 19 218 10342400
316337221 gardengnome C April 20, 2025, 5:41 a.m. OK PyPy 3-64 TESTS 19 233 15974400
316317713 sergo895 C April 19, 2025, 10:35 p.m. OK PyPy 3-64 TESTS 19 233 16076800
316283627 opbot_xd C April 19, 2025, 4:19 p.m. OK PyPy 3-64 TESTS 19 233 32972800
316288885 Coder_Sabbir C April 19, 2025, 4:34 p.m. OK PyPy 3-64 TESTS 19 234 16179200
316315692 Om_Singh_ C April 19, 2025, 9:48 p.m. OK PyPy 3-64 TESTS 19 234 16281600
316277439 gsahasra13 C April 19, 2025, 4:01 p.m. OK PyPy 3-64 TESTS 19 234 16691200
316299271 TerryYangUSA C April 19, 2025, 6:14 p.m. OK PyPy 3-64 TESTS 19 234 23961600
316294098 jskim7018 C April 19, 2025, 5:29 p.m. OK PyPy 3-64 TESTS 19 249 15872000
316319692 SoleProprietor C April 19, 2025, 11:37 p.m. OK PyPy 3-64 TESTS 19 249 16281600
316332034 qingdian C April 20, 2025, 4:27 a.m. OK Python 2 TESTS 19 1093 113766400
316301668 cuevasrja C April 19, 2025, 6:36 p.m. OK Python 3 TESTS 19 561 44953600
316283272 trungkien1252010 C April 19, 2025, 4:18 p.m. OK Python 3 TESTS 19 609 45056000
316278605 nat1q C April 19, 2025, 4:04 p.m. OK Python 3 TESTS 19 624 44953600
316306625 innocent34 C April 19, 2025, 7:32 p.m. OK Python 3 TESTS 19 655 44544000
316277653 _Pradeep__Kumar___ C April 19, 2025, 4:01 p.m. OK Python 3 TESTS 19 671 44953600
316273383 keshavfire12345 C April 19, 2025, 3:49 p.m. OK Python 3 TESTS 19 671 44953600
316275052 The_Black_Bird C April 19, 2025, 3:53 p.m. OK Python 3 TESTS 19 671 45158400
316284312 sahilmit C April 19, 2025, 4:21 p.m. OK Python 3 TESTS 19 686 45056000
316287972 natigmammadov C April 19, 2025, 4:32 p.m. OK Python 3 TESTS 19 686 45158400
316285172 dupen C April 19, 2025, 4:24 p.m. OK Python 3 TESTS 19 702 45158400
316325797 kingcabrams C April 20, 2025, 2:24 a.m. OK Rust 2021 TESTS 19 108 5120000
316303063 esrever C April 19, 2025, 6:51 p.m. OK Rust 2021 TESTS 19 109 6348800
316303234 kingcabrams C April 19, 2025, 6:52 p.m. OK Rust 2021 TESTS 19 124 5120000
316272494 Newstart27 C April 19, 2025, 3:46 p.m. OK Rust 2021 TESTS 19 124 6451200
316307782 v1kasja1swal C April 19, 2025, 7:47 p.m. OK Rust 2021 TESTS 19 249 23449600

remove filters

Back to search problems