Codeforces Round 938 (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
1955 Codeforces Round 938 (Div. 3) FINISHED False 8100 19236299 April 8, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 28052 ) B Progressive Square PROGRAMMING constructive algorithms data structures implementation sortings

B'A progressive square of size n is an n x n matrix. Maxim chooses three integers a_{1,1} , c , and d and constructs a progressive square according to the following rules: a_{i+1,j} = a_{i,j} + c a_{i,j+1} = a_{i,j} + d For example, if n = 3 , a_{1,1} = 1 , c=2 , and d=3 , then the progressive square looks as follows: begin{pmatrix} 1 & 4 & 7 3 & 6 & 9 5 & 8 & 11 end{pmatrix} Last month Maxim constructed a progressive square and remembered the values of n , c , and d . Recently, he found an array b of n^2 integers in random order and wants to make sure that these elements are the elements of that specific square. It can be shown that for any values of n , a_{1,1} , c , and d , there exists exactly one progressive square that satisfies all the rules. The first line contains an integer t ( 1 <= t <= {10} ^ 4 ) -- the number of test cases. The first line of each test case contains three integers n , c , and d ( 2 <= n <= 500 , 1 <= c, d <= 10^6 ) -- the size of the square and the values of c and d as described in the statement. The second line of each test case contains n cdot n integers b_1, b_2, ... , b_{n cdot n} ( 1 <= b_i <= 10^9 ) -- the elements found by Maxim. It is guaranteed that the sum of n ^ 2 over all test cases does not exceed 25 cdot {10} ^ 4 . For each test case, output "YES" in a separate line if a progressive square for the given n , c , and d can be constructed from the array elements a , otherwise output "NO". You can output each letter in any case (lowercase or uppercase). For example, the strings "yEs", "yes", "Yes", and "YES" will be accepted as a positive answer. '...

Tutorials

128243

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
255799878 karamkontar B April 9, 2024, 12:27 a.m. OK C# 10 TESTS 4 140 29184000
255819513 Qmaple B April 9, 2024, 5:03 a.m. OK C++14 (GCC 6-32) TESTS 4 93 0
255807030 3449 B April 9, 2024, 2:28 a.m. OK C++14 (GCC 6-32) TESTS 4 93 2048000
255802509 zxk777 B April 9, 2024, 1:14 a.m. OK C++14 (GCC 6-32) TESTS 4 93 2150400
255766279 Namkhing B April 8, 2024, 5:39 p.m. OK C++14 (GCC 6-32) TESTS 4 108 0
255808605 SaturdayForever B April 9, 2024, 2:48 a.m. OK C++14 (GCC 6-32) TESTS 4 108 102400
255819751 PILGR1M_ B April 9, 2024, 5:06 a.m. OK C++14 (GCC 6-32) TESTS 4 108 102400
255784736 prince_019 B April 8, 2024, 8:21 p.m. OK C++14 (GCC 6-32) TESTS 4 108 409600
255815769 gujie B April 9, 2024, 4:19 a.m. OK C++14 (GCC 6-32) TESTS 4 109 0
255819233 PILGR1M_ B April 9, 2024, 5 a.m. OK C++14 (GCC 6-32) TESTS 4 109 0
255815578 I_need_7.0_IELTS B April 9, 2024, 4:16 a.m. OK C++14 (GCC 6-32) TESTS 4 109 0
255790622 Din_ED B April 8, 2024, 9:34 p.m. OK C++17 (GCC 7-32) TESTS 4 93 0
255822306 LateBloom B April 9, 2024, 5:31 a.m. OK C++17 (GCC 7-32) TESTS 4 93 0
255821114 voyager24 B April 9, 2024, 5:19 a.m. OK C++17 (GCC 7-32) TESTS 4 93 0
255814573 happydreamer B April 9, 2024, 4:03 a.m. OK C++17 (GCC 7-32) TESTS 4 93 0
255800631 Gopal252 B April 9, 2024, 12:41 a.m. OK C++17 (GCC 7-32) TESTS 4 93 0
255768454 tahmids55 B April 8, 2024, 5:53 p.m. OK C++17 (GCC 7-32) TESTS 4 93 0
255791533 AerialSpy4 B April 8, 2024, 9:48 p.m. OK C++17 (GCC 7-32) TESTS 4 93 102400
255786100 H3m3nDra B April 8, 2024, 8:37 p.m. OK C++17 (GCC 7-32) TESTS 4 93 307200
255815111 rahulsukare07 B April 9, 2024, 4:10 a.m. OK C++17 (GCC 7-32) TESTS 4 93 2457600
255809508 cho12 B April 9, 2024, 3 a.m. OK C++17 (GCC 7-32) TESTS 4 93 3686400
255824186 Banlangk B April 9, 2024, 5:48 a.m. OK C++20 (GCC 13-64) TESTS 4 78 0
255820718 the_fool B April 9, 2024, 5:15 a.m. OK C++20 (GCC 13-64) TESTS 4 78 0
255790695 cmottao B April 8, 2024, 9:35 p.m. OK C++20 (GCC 13-64) TESTS 4 78 102400
255786697 Shorbagy27 B April 8, 2024, 8:43 p.m. OK C++20 (GCC 13-64) TESTS 4 78 102400
255812904 archiit B April 9, 2024, 3:42 a.m. OK C++20 (GCC 13-64) TESTS 4 78 2560000
255779190 LightSky B April 8, 2024, 7:22 p.m. OK C++20 (GCC 13-64) TESTS 4 78 2662400
255785597 parasdua1130 B April 8, 2024, 8:31 p.m. OK C++20 (GCC 13-64) TESTS 4 78 2662400
255776166 ammar007 B April 8, 2024, 6:53 p.m. OK C++20 (GCC 13-64) TESTS 4 92 512000
255820208 jha_om B April 9, 2024, 5:10 a.m. OK C++20 (GCC 13-64) TESTS 4 93 0
255817504 DragonKingA B April 9, 2024, 4:41 a.m. OK C++20 (GCC 13-64) TESTS 4 93 0
255799733 bluemegane B April 9, 2024, 12:24 a.m. OK C# 8 TESTS 4 140 23449600
255782198 NenadDapic B April 8, 2024, 7:53 p.m. OK FPC TESTS 4 140 3072000
255823896 cwz2024 B April 9, 2024, 5:45 a.m. OK GNU C11 TESTS 4 124 6041600
255820500 samyasar2002 B April 9, 2024, 5:13 a.m. OK GNU C11 TESTS 4 249 4096000
255820022 123_wby B April 9, 2024, 5:08 a.m. OK Go TESTS 4 156 12800000
255796113 ItsLever B April 8, 2024, 11:10 p.m. OK Java 21 TESTS 4 281 5632000
255772393 bytecoder18943 B April 8, 2024, 6:22 p.m. OK Java 21 TESTS 4 327 4710400
255766391 Andr0Dev B April 8, 2024, 5:40 p.m. OK Java 21 TESTS 4 343 6348800
255769510 priyaroy3370 B April 8, 2024, 6 p.m. OK Java 21 TESTS 4 358 1945600
255769689 dineshchandran311 B April 8, 2024, 6:02 p.m. OK Java 21 TESTS 4 358 7168000
255787941 polsage B April 8, 2024, 8:58 p.m. OK Java 21 TESTS 4 390 13721600
255825478 shahzan B April 9, 2024, 6 a.m. OK Java 21 TESTS 4 406 29184000
255785651 Tjha B April 8, 2024, 8:32 p.m. OK Java 21 TESTS 4 421 5734400
255783740 geniusmov B April 8, 2024, 8:10 p.m. OK Java 21 TESTS 4 421 23142400
255815297 _ShenHua_ B April 9, 2024, 4:12 a.m. OK Java 21 TESTS 4 452 11980800
255780890 Safawt B April 8, 2024, 7:40 p.m. OK Java 8 TESTS 4 202 13926400
255797477 NerfThis B April 8, 2024, 11:38 p.m. OK Java 8 TESTS 4 218 9932800
255811524 _z_ZZ B April 9, 2024, 3:25 a.m. OK Java 8 TESTS 4 218 12697600
255794344 Yashk0618 B April 8, 2024, 10:35 p.m. OK Java 8 TESTS 4 233 10137600
255788443 Sumitsingh7 B April 8, 2024, 9:04 p.m. OK Java 8 TESTS 4 265 6963200
255808912 QYSLBLSHzz B April 9, 2024, 2:52 a.m. OK Java 8 TESTS 4 265 25088000
255818118 wuhu_ac B April 9, 2024, 4:48 a.m. OK Java 8 TESTS 4 467 0
255803460 233030202 B April 9, 2024, 1:29 a.m. OK Java 8 TESTS 4 483 0
255801128 wuhu_ac B April 9, 2024, 12:50 a.m. OK Java 8 TESTS 4 499 0
255774290 Baidiki B April 8, 2024, 6:37 p.m. OK Java 8 TESTS 4 499 0
255768978 amin2783 B April 8, 2024, 5:57 p.m. OK PyPy 3 TESTS 4 343 27340800
255800240 bboo_123 B April 9, 2024, 12:34 a.m. OK PyPy 3 TESTS 4 405 21913600
255822164 abhay_30281125 B April 9, 2024, 5:29 a.m. OK PyPy 3 TESTS 4 436 18022400
255813777 MY963 B April 9, 2024, 3:53 a.m. OK PyPy 3 TESTS 4 468 18636800
255768623 Codness50 B April 8, 2024, 5:54 p.m. OK PyPy 3-64 TESTS 4 187 39424000
255783864 cybsbbb B April 8, 2024, 8:12 p.m. OK PyPy 3-64 TESTS 4 187 39731200
255823945 oneman38669 B April 9, 2024, 5:46 a.m. OK PyPy 3-64 TESTS 4 202 26521600
255813813 tccx18 B April 9, 2024, 3:53 a.m. OK PyPy 3-64 TESTS 4 202 34406400
255786866 OmarMoBadr B April 8, 2024, 8:45 p.m. OK PyPy 3-64 TESTS 4 233 28876800
255814805 volimak B April 9, 2024, 4:06 a.m. OK PyPy 3-64 TESTS 4 233 34508800
255820996 Taymyr B April 9, 2024, 5:18 a.m. OK PyPy 3-64 TESTS 4 233 36352000
255788448 abhaumik24 B April 8, 2024, 9:04 p.m. OK PyPy 3-64 TESTS 4 233 37171200
255815902 Mohamed_Hamed B April 9, 2024, 4:21 a.m. OK PyPy 3-64 TESTS 4 234 25702400
255811302 Nabaranjan B April 9, 2024, 3:22 a.m. OK PyPy 3-64 TESTS 4 234 34508800
255819227 kevin2610 B April 9, 2024, 5 a.m. OK Python 3 TESTS 4 218 30720000
255784620 Karim__2 B April 8, 2024, 8:20 p.m. OK Python 3 TESTS 4 234 30720000
255772196 shantanu42 B April 8, 2024, 6:21 p.m. OK Python 3 TESTS 4 249 30720000
255771569 ZaidSaadeh B April 8, 2024, 6:16 p.m. OK Python 3 TESTS 4 249 30822400
255788033 Daniel_14 B April 8, 2024, 8:59 p.m. OK Python 3 TESTS 4 249 32051200
255769492 Love_744 B April 8, 2024, 6 p.m. OK Python 3 TESTS 4 250 30822400
255818559 aryui_2902 B April 9, 2024, 4:53 a.m. OK Python 3 TESTS 4 250 32051200
255784802 jossy_ B April 8, 2024, 8:22 p.m. OK Python 3 TESTS 4 264 29696000
255789697 Ante_ B April 8, 2024, 9:21 p.m. OK Python 3 TESTS 4 265 29696000
255823970 lil_himick B April 9, 2024, 5:46 a.m. OK Python 3 TESTS 4 265 30822400

remove filters

Back to search problems