Codeforces Round 770 (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
1634 Codeforces Round 770 (Div. 2) FINISHED False 9000 93021863 Feb. 6, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 18369 ) C OKEA PROGRAMMING constructive algorithms math

B'You work for a well-known department store that uses leading technologies and employs mechanistic work -- that is, robots! The department you work in sells n cdot k items. The first item costs 1 dollar, the second item costs 2 dollars, and so on: i -th item costs i dollars. The items are situated on shelves. The items form a rectangular grid: there are n shelves in total, and each shelf contains exactly k items. We will denote by a_{i,j} the price of j -th item (counting from the left) on the i -th shelf, 1 <= i <= n, 1 <= j <= k . Occasionally robots get curious and ponder on the following question: what is the mean price (arithmetic average) of items a_{i,l}, a_{i,l+1}, ldots, a_{i,r} for some shelf i and indices l <= r ? Unfortunately, the old robots can only work with whole numbers. If the mean price turns out not to be an integer, they break down. You care about robots ' welfare. You want to arrange the items in such a way that the robots cannot theoretically break. Formally, you want to choose such a two-dimensional array a that: Find out if such an arrangement is possible, and if it is, give any example of such arrangement. The first line contains a single integer t ( 1 <= t <= 500 ) -- the number of test cases. The first and only line of each test case contains two integers n and k ( 1 <= n, k <= 500 ) -- the number of shelves and length of each shelf, respectively. It is guaranteed that the sum n over all test cases does not exceed 500 and the sum k over all test cases does not exceed 500 . Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on n lines of k numbers each, one line per shelf. Each number from 1 to n cdot k must occur exactly once in the output. If no good arrangement exists, print a sin'...

Tutorials

Codeforces Round #770 (Div. 2) editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
145468319 tanisha_daharwal C Feb. 6, 2022, 5:46 p.m. OK GNU C11 TESTS 7 951 0
145472010 406 C Feb. 6, 2022, 6:11 p.m. OK GNU C11 TESTS 7 966 0
145457073 wsd0525wsd C Feb. 6, 2022, 4:40 p.m. OK GNU C11 TESTS 7 967 0
145459466 1435730 C Feb. 6, 2022, 4:47 p.m. OK GNU C11 TESTS 7 967 0
145487449 gxlois C Feb. 7, 2022, 12:30 a.m. OK GNU C11 TESTS 7 967 0
145470471 keshavgupta06 C Feb. 6, 2022, 5:58 p.m. OK GNU C11 TESTS 7 982 0
145472866 406 C Feb. 6, 2022, 6:20 p.m. OK GNU C11 TESTS 7 982 0
145459164 yocki8 C Feb. 6, 2022, 4:46 p.m. OK GNU C11 TESTS 7 998 0
145459598 2018339901318 C Feb. 6, 2022, 4:48 p.m. OK GNU C11 TESTS 7 998 0
145463014 mohansscf C Feb. 6, 2022, 4:57 p.m. OK GNU C11 TESTS 7 998 0
145478066 Ayham3 C Feb. 6, 2022, 7:30 p.m. OK GNU C++14 TESTS 7 15 0
145502186 SrinivasTeja C Feb. 7, 2022, 5:48 a.m. OK GNU C++14 TESTS 7 15 0
145472079 ZilanJaman C Feb. 6, 2022, 6:11 p.m. OK GNU C++14 TESTS 7 15 0
145496840 885377999 C Feb. 7, 2022, 4:28 a.m. OK GNU C++14 TESTS 7 30 0
145502787 jzcrq C Feb. 7, 2022, 5:56 a.m. OK GNU C++14 TESTS 7 30 0
145502249 itz_archit C Feb. 7, 2022, 5:49 a.m. OK GNU C++14 TESTS 7 30 0
145502146 Paqis C Feb. 7, 2022, 5:48 a.m. OK GNU C++14 TESTS 7 30 0
145498498 impavan C Feb. 7, 2022, 4:55 a.m. OK GNU C++14 TESTS 7 30 0
145496011 Deartanker_ C Feb. 7, 2022, 4:12 a.m. OK GNU C++14 TESTS 7 30 0
145494929 pgthakur C Feb. 7, 2022, 3:52 a.m. OK GNU C++14 TESTS 7 30 0
145464009 sunho C Feb. 6, 2022, 5 p.m. OK GNU C++17 TESTS 7 15 0
145466191 pikaboo23 C Feb. 6, 2022, 5:04 p.m. OK GNU C++17 TESTS 7 15 0
145472339 neew_B_2.0 C Feb. 6, 2022, 6:14 p.m. OK GNU C++17 TESTS 7 15 0
145476448 prokraft C Feb. 6, 2022, 7:03 p.m. OK GNU C++17 TESTS 7 15 0
145477446 TamirShahar C Feb. 6, 2022, 7:19 p.m. OK GNU C++17 TESTS 7 15 0
145481325 ashokk C Feb. 6, 2022, 8:36 p.m. OK GNU C++17 TESTS 7 15 0
145481546 rafatoa C Feb. 6, 2022, 8:42 p.m. OK GNU C++17 TESTS 7 15 0
145487467 Lao_yang C Feb. 7, 2022, 12:31 a.m. OK GNU C++17 TESTS 7 15 0
145501053 nikhilreddydev C Feb. 7, 2022, 5:32 a.m. OK GNU C++17 TESTS 7 15 0
145502632 satyam954 C Feb. 7, 2022, 5:55 a.m. OK GNU C++17 TESTS 7 15 0
145490735 kingshukroy C Feb. 7, 2022, 2:22 a.m. OK GNU C++17 (64) TESTS 7 15 0
145469075 Arnav.roy C Feb. 6, 2022, 5:49 p.m. OK GNU C++17 (64) TESTS 7 15 0
145458867 Yelarys C Feb. 6, 2022, 4:46 p.m. OK GNU C++17 (64) TESTS 7 15 0
145458514 mengyifei C Feb. 6, 2022, 4:45 p.m. OK GNU C++17 (64) TESTS 7 15 0
145500007 anil_1 C Feb. 7, 2022, 5:17 a.m. OK GNU C++17 (64) TESTS 7 15 0
145495375 maycod23 C Feb. 7, 2022, 4:01 a.m. OK GNU C++17 (64) TESTS 7 30 0
145494249 hKel C Feb. 7, 2022, 3:39 a.m. OK GNU C++17 (64) TESTS 7 30 0
145494059 Siesta. C Feb. 7, 2022, 3:36 a.m. OK GNU C++17 (64) TESTS 7 30 0
145492733 zefyrus C Feb. 7, 2022, 3:08 a.m. OK GNU C++17 (64) TESTS 7 30 0
145499874 Haven_ C Feb. 7, 2022, 5:15 a.m. OK GNU C++17 (64) TESTS 7 30 0
145496674 _ywl C Feb. 7, 2022, 4:25 a.m. OK GNU C++20 (64) TESTS 7 15 0
145502323 saurav_kalsoor C Feb. 7, 2022, 5:50 a.m. OK GNU C++20 (64) TESTS 7 15 0
145502070 FReAk C Feb. 7, 2022, 5:47 a.m. OK GNU C++20 (64) TESTS 7 15 0
145500593 pigeon_fan C Feb. 7, 2022, 5:26 a.m. OK GNU C++20 (64) TESTS 7 15 0
145499530 rahul6599 C Feb. 7, 2022, 5:10 a.m. OK GNU C++20 (64) TESTS 7 15 0
145499423 t_srk C Feb. 7, 2022, 5:08 a.m. OK GNU C++20 (64) TESTS 7 15 0
145498703 shiv_314 C Feb. 7, 2022, 4:58 a.m. OK GNU C++20 (64) TESTS 7 15 0
145498463 Mxrush C Feb. 7, 2022, 4:54 a.m. OK GNU C++20 (64) TESTS 7 15 0
145497905 parasgami3 C Feb. 7, 2022, 4:45 a.m. OK GNU C++20 (64) TESTS 7 15 0
145496584 _ywl C Feb. 7, 2022, 4:23 a.m. OK GNU C++20 (64) TESTS 7 15 0
145463859 pawtny C Feb. 6, 2022, 4:59 p.m. OK Go TESTS 7 78 1024000
145496335 MadDuke C Feb. 7, 2022, 4:18 a.m. OK Java 11 TESTS 7 171 0
145491906 Andwerp C Feb. 7, 2022, 2:51 a.m. OK Java 11 TESTS 7 171 0
145473016 SaberXpro C Feb. 6, 2022, 6:21 p.m. OK Java 11 TESTS 7 186 0
145501832 as9274 C Feb. 7, 2022, 5:43 a.m. OK Java 11 TESTS 7 187 0
145498400 ND_ C Feb. 7, 2022, 4:53 a.m. OK Java 11 TESTS 7 187 0
145482145 Toinfinity C Feb. 6, 2022, 8:59 p.m. OK Java 11 TESTS 7 187 0
145475484 SAMAD_ C Feb. 6, 2022, 6:50 p.m. OK Java 11 TESTS 7 202 0
145500025 montugol32 C Feb. 7, 2022, 5:17 a.m. OK Java 11 TESTS 7 202 0
145471158 Longgggggggg C Feb. 6, 2022, 6:03 p.m. OK Java 11 TESTS 7 202 0
145469926 KarMa_ C Feb. 6, 2022, 5:53 p.m. OK Java 11 TESTS 7 202 0
145468386 amit_roy C Feb. 6, 2022, 5:46 p.m. OK Java 8 TESTS 7 93 3379200
145473132 ss804 C Feb. 6, 2022, 6:22 p.m. OK Java 8 TESTS 7 109 3379200
145499127 DoPractice C Feb. 7, 2022, 5:04 a.m. OK Java 8 TESTS 7 124 0
145461599 aryaman_571 C Feb. 6, 2022, 4:53 p.m. OK Java 8 TESTS 7 139 0
145464221 vivmost14 C Feb. 6, 2022, 5 p.m. OK Java 8 TESTS 7 139 2457600
145491681 leonlian C Feb. 7, 2022, 2:46 a.m. OK Java 8 TESTS 7 140 0
145463003 g906360 C Feb. 6, 2022, 4:57 p.m. OK Java 8 TESTS 7 140 0
145486356 XiaoLingYa C Feb. 6, 2022, 11:40 p.m. OK Java 8 TESTS 7 841 0
145481998 0xRmQu C Feb. 6, 2022, 8:55 p.m. OK Java 8 TESTS 7 842 0
145459988 lakshay.sharma.ug21 C Feb. 6, 2022, 4:49 p.m. OK Java 8 TESTS 7 857 0
145457855 v4_adi C Feb. 6, 2022, 4:43 p.m. OK Kotlin 1.5 TESTS 7 982 0
145503027 lhcalphaA C Feb. 7, 2022, 5:59 a.m. OK MS C++ 2017 TESTS 7 124 0
145490642 edfearay11 C Feb. 7, 2022, 2:20 a.m. OK MS C++ 2017 TESTS 7 124 0
145481908 M7md3sam070 C Feb. 6, 2022, 8:52 p.m. OK MS C++ 2017 TESTS 7 124 0
145470340 MRX7 C Feb. 6, 2022, 5:57 p.m. OK MS C++ 2017 TESTS 7 124 0
145493736 Ir0nic_Joker C Feb. 7, 2022, 3:29 a.m. OK MS C++ 2017 TESTS 7 140 0
145494666 _Rimjhim_36 C Feb. 7, 2022, 3:47 a.m. OK MS C++ 2017 TESTS 7 140 1024000
145460946 dominotim C Feb. 6, 2022, 4:51 p.m. OK MS C++ 2017 TESTS 7 140 1126400
145458526 Blejac C Feb. 6, 2022, 4:45 p.m. OK MS C++ 2017 TESTS 7 140 1126400
145488188 Tangerine C Feb. 7, 2022, 1:01 a.m. OK MS C++ 2017 TESTS 7 140 2150400
145466020 .rong. C Feb. 6, 2022, 5:04 p.m. OK MS C++ 2017 TESTS 7 156 0
145468363 1_2_3_4_5_9 C Feb. 6, 2022, 5:46 p.m. OK PyPy 2 TESTS 7 155 5120000
145471680 KeiTsukishima C Feb. 6, 2022, 6:07 p.m. OK PyPy 3 TESTS 7 140 10444800
145483497 ayshiff C Feb. 6, 2022, 9:43 p.m. OK PyPy 3 TESTS 7 202 4710400
145470156 akshat11 C Feb. 6, 2022, 5:55 p.m. OK PyPy 3 TESTS 7 233 9625600
145469053 shivam_hbtu C Feb. 6, 2022, 5:48 p.m. OK PyPy 3 TESTS 7 233 9625600
145458584 ajaystark C Feb. 6, 2022, 4:45 p.m. OK PyPy 3 TESTS 7 248 9420800
145478116 whatshisbucket C Feb. 6, 2022, 7:30 p.m. OK PyPy 3 TESTS 7 248 9625600
145473035 hwei002 C Feb. 6, 2022, 6:21 p.m. OK PyPy 3 TESTS 7 248 9830400
145491029 toam C Feb. 7, 2022, 2:31 a.m. OK PyPy 3 TESTS 7 249 9523200
145462279 Aksnov C Feb. 6, 2022, 4:55 p.m. OK PyPy 3 TESTS 7 280 5427200
145474211 tcltk C Feb. 6, 2022, 6:34 p.m. OK PyPy 3 TESTS 7 296 9830400
145472982 aman_m42 C Feb. 6, 2022, 6:21 p.m. OK PyPy 3-64 TESTS 7 139 12595200
145482675 MonkeyDoug C Feb. 6, 2022, 9:15 p.m. OK PyPy 3-64 TESTS 7 155 5734400
145482716 MonkeyDoug C Feb. 6, 2022, 9:17 p.m. OK PyPy 3-64 TESTS 7 155 5939200
145457178 mayank35 C Feb. 6, 2022, 4:41 p.m. OK PyPy 3-64 TESTS 7 155 8396800
145458971 SalatL C Feb. 6, 2022, 4:46 p.m. OK PyPy 3-64 TESTS 7 171 3993600
145478612 kaustavshouvik C Feb. 6, 2022, 7:39 p.m. OK PyPy 3-64 TESTS 7 171 8499200
145462116 waterwav3 C Feb. 6, 2022, 4:55 p.m. OK PyPy 3-64 TESTS 7 171 9420800
145468507 hash1023 C Feb. 6, 2022, 5:46 p.m. OK PyPy 3-64 TESTS 7 171 11673600
145465042 DeathIsAwe C Feb. 6, 2022, 5:02 p.m. OK PyPy 3-64 TESTS 7 186 5939200
145497186 shardul_rajhans C Feb. 7, 2022, 4:34 a.m. OK PyPy 3-64 TESTS 7 187 8499200
145464479 StratusEvent C Feb. 6, 2022, 5:01 p.m. OK Python 3 TESTS 7 140 0
145457792 Vssca C Feb. 6, 2022, 4:43 p.m. OK Python 3 TESTS 7 156 6144000
145481719 primavera6 C Feb. 6, 2022, 8:47 p.m. OK Python 3 TESTS 7 171 0
145462494 da.2396 C Feb. 6, 2022, 4:56 p.m. OK Python 3 TESTS 7 171 102400
145459291 WenqingWenqing C Feb. 6, 2022, 4:47 p.m. OK Python 3 TESTS 7 171 8396800
145499624 machffud.thv C Feb. 7, 2022, 5:11 a.m. OK Python 3 TESTS 7 280 0
145475361 eugalt C Feb. 6, 2022, 6:48 p.m. OK Python 3 TESTS 7 280 0
145474072 0Bit_Memory C Feb. 6, 2022, 6:32 p.m. OK Python 3 TESTS 7 280 0
145480156 joshi.cse.13 C Feb. 6, 2022, 8:10 p.m. OK Python 3 TESTS 7 295 0
145497459 Bishwanath C Feb. 7, 2022, 4:38 a.m. OK Python 3 TESTS 7 296 0
145503206 Spheniscine C Feb. 7, 2022, 6:01 a.m. OK Rust 2021 TESTS 7 15 2355200
145471596 RustyInCP C Feb. 6, 2022, 6:07 p.m. OK Rust 2021 TESTS 7 31 0
145482007 7Midav7 C Feb. 6, 2022, 8:55 p.m. OK Scala TESTS 7 561 4403200

remove filters

Back to search problems