Codeforces Round 626 (Div. 2, based on Moscow Open Olympiad in Informatics)

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
1323 Codeforces Round 626 (Div. 2, based on Moscow Open Olympiad in Informatics) FINISHED False 7200 153779111 March 7, 2020, 9:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9308 ) B Count Subrectangles PROGRAMMING greedy implementation

B"You are given an array a of length n and array b of length m both consisting of only integers 0 and 1 . Consider a matrix c of size n x m formed by following rule: c_{i, j} = a_i cdot b_j (i.e. a_i multiplied by b_j ). It's easy to see that c consists of only zeroes and ones too. How many subrectangles of size (area) k consisting only of ones are there in c ? A subrectangle is an intersection of a consecutive (subsequent) segment of rows and a consecutive (subsequent) segment of columns. I.e. consider four integers x_1, x_2, y_1, y_2 ( 1 <= x_1 <= x_2 <= n , 1 <= y_1 <= y_2 <= m ) a subrectangle c[x_1 ... x_2][y_1 ... y_2] is an intersection of the rows x_1, x_1+1, x_1+2, ... , x_2 and the columns y_1, y_1+1, y_1+2, ... , y_2 . The size (area) of a subrectangle is the total number of cells in it. The first line contains three integers n , m and k ( 1 <= q n, m <= q 40 ,000, 1 <= q k <= q n cdot m ), length of array a , length of array b and required size of subrectangles. The second line contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_i <= q 1 ), elements of a . The third line contains m integers b_1, b_2, ldots, b_m ( 0 <= q b_i <= q 1 ), elements of b . Output single integer -- the number of subrectangles of c with size (area) k consisting only of ones. In first example matrix c is: There are 4 subrectangles of size 2 consisting of only ones in it: In second example matrix c is: "...

Tutorials

Codeforces Round #626 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
72663230 peter112358 B March 7, 2020, 12:53 p.m. OK Clang++17 Diagnostics TESTS 41 77 15667200
72638328 daut-dlang B March 7, 2020, 10:04 a.m. OK D TESTS 41 31 4198400
72637672 TheHedgehog B March 7, 2020, 10:02 a.m. OK Delphi TESTS 41 140 5324800
72666214 denchik007orel57 B March 7, 2020, 1:36 p.m. OK FPC TESTS 41 46 921600
72666065 denchik007orel57 B March 7, 2020, 1:34 p.m. OK FPC TESTS 41 46 1740800
72699293 dogdealer27 B March 8, 2020, 2:36 a.m. OK GNU C11 TESTS 41 46 614400
72648259 YOK B March 7, 2020, 10:43 a.m. OK GNU C11 TESTS 41 46 921600
72635014 YanWQmonad B March 7, 2020, 9:52 a.m. OK GNU C++11 TESTS 41 30 15974400
72639409 Early B March 7, 2020, 10:08 a.m. OK GNU C++11 TESTS 41 31 102400
72639661 dblark B March 7, 2020, 10:09 a.m. OK GNU C++11 TESTS 41 31 102400
72640188 BIT_superRookie19 B March 7, 2020, 10:11 a.m. OK GNU C++11 TESTS 41 31 102400
72644946 function_of_zero B March 7, 2020, 10:29 a.m. OK GNU C++11 TESTS 41 31 204800
72647816 zhoufangyuanPT B March 7, 2020, 10:41 a.m. OK GNU C++11 TESTS 41 31 204800
72637015 ryuIo B March 7, 2020, 9:59 a.m. OK GNU C++11 TESTS 41 31 307200
72656931 windwalker B March 7, 2020, 11:26 a.m. OK GNU C++11 TESTS 41 31 307200
72641269 hhoppitree B March 7, 2020, 10:15 a.m. OK GNU C++11 TESTS 41 31 307200
72676296 vjudge4 B March 7, 2020, 4:24 p.m. OK GNU C++11 TESTS 41 31 409600
72666196 zcb B March 7, 2020, 1:36 p.m. OK GNU C++14 TESTS 41 31 512000
72638421 QieziMin B March 7, 2020, 10:04 a.m. OK GNU C++14 TESTS 41 31 1228800
72658020 AUAICN B March 7, 2020, 11:30 a.m. OK GNU C++14 TESTS 41 31 1331200
72635617 mayiyang B March 7, 2020, 9:54 a.m. OK GNU C++14 TESTS 41 31 1638400
72639638 Ramprosad B March 7, 2020, 10:09 a.m. OK GNU C++14 TESTS 41 31 2048000
72642885 dsl2002 B March 7, 2020, 10:22 a.m. OK GNU C++14 TESTS 41 31 3993600
72654882 phamnhatnam B March 7, 2020, 11:15 a.m. OK GNU C++14 TESTS 41 31 48128000
72655174 hua_shuo B March 7, 2020, 11:17 a.m. OK GNU C++14 TESTS 41 46 102400
72645794 kZime B March 7, 2020, 10:33 a.m. OK GNU C++14 TESTS 41 46 102400
72666459 iShibly B March 7, 2020, 1:40 p.m. OK GNU C++14 TESTS 41 46 204800
72671030 Dhrubo52 B March 7, 2020, 2:50 p.m. OK GNU C++17 TESTS 41 31 819200
72646679 fake_pecha B March 7, 2020, 10:36 a.m. OK GNU C++17 TESTS 41 31 1228800
72672864 shawwww B March 7, 2020, 3:24 p.m. OK GNU C++17 TESTS 41 31 1331200
72661642 leaked B March 7, 2020, 12:31 p.m. OK GNU C++17 TESTS 41 31 2355200
72650316 ca1xukun B March 7, 2020, 10:52 a.m. OK GNU C++17 TESTS 41 31 2560000
72640513 Umalaka B March 7, 2020, 10:12 a.m. OK GNU C++17 TESTS 41 31 3174400
72671083 Skypower B March 7, 2020, 2:52 p.m. OK GNU C++17 TESTS 41 31 4608000
72655497 S1NC B March 7, 2020, 11:18 a.m. OK GNU C++17 TESTS 41 46 102400
72650049 haha020 B March 7, 2020, 10:51 a.m. OK GNU C++17 TESTS 41 46 102400
72669736 Buletsa B March 7, 2020, 2:29 p.m. OK GNU C++17 TESTS 41 46 204800
72646125 snow_bear_328 B March 7, 2020, 10:34 a.m. OK Go TESTS 41 46 0
72636957 Jughead B March 7, 2020, 9:59 a.m. OK Go TESTS 41 46 0
72680954 starius B March 7, 2020, 5:23 p.m. OK Go TESTS 41 46 4505600
72640704 synapse B March 7, 2020, 10:13 a.m. OK Go TESTS 41 62 0
72671598 synapse B March 7, 2020, 3:01 p.m. OK Go TESTS 41 77 0
72645009 toterpinguin B March 7, 2020, 10:30 a.m. OK Go TESTS 41 140 8908800
72675114 serafimkoo B March 7, 2020, 4:03 p.m. OK Java 11 TESTS 41 187 0
72673629 redbin0471 B March 7, 2020, 3:37 p.m. OK Java 11 TESTS 41 187 0
72651381 sakt_coder B March 7, 2020, 10:57 a.m. OK Java 11 TESTS 41 202 0
72635194 jenish9599 B March 7, 2020, 9:53 a.m. OK Java 11 TESTS 41 202 0
72657445 Oom B March 7, 2020, 11:28 a.m. OK Java 11 TESTS 41 218 0
72650124 elkadymohammed01 B March 7, 2020, 10:51 a.m. OK Java 11 TESTS 41 218 0
72655349 Great_Expectations_ B March 7, 2020, 11:17 a.m. OK Java 11 TESTS 41 296 102400
72649604 parina1 B March 7, 2020, 10:49 a.m. OK Java 11 TESTS 41 296 102400
72649589 sajju B March 7, 2020, 10:49 a.m. OK Java 11 TESTS 41 296 102400
72661174 kevincentius B March 7, 2020, 12:27 p.m. OK Java 11 TESTS 41 326 307200
72665277 Faizan B March 7, 2020, 1:22 p.m. OK Java 8 TESTS 41 109 0
72640411 amolpratap007 B March 7, 2020, 10:12 a.m. OK Java 8 TESTS 41 109 0
72690591 ZerooCool B March 7, 2020, 8:41 p.m. OK Java 8 TESTS 41 124 0
72648067 bluesky111 B March 7, 2020, 10:42 a.m. OK Java 8 TESTS 41 124 0
72646781 BNL B March 7, 2020, 10:37 a.m. OK Java 8 TESTS 41 124 0
72646177 Charlesna B March 7, 2020, 10:34 a.m. OK Java 8 TESTS 41 124 0
72657566 cis_pie B March 7, 2020, 11:28 a.m. OK Java 8 TESTS 41 139 0
72648363 awesomelemonade B March 7, 2020, 10:43 a.m. OK Java 8 TESTS 41 139 0
72638890 mufaddalnaya B March 7, 2020, 10:06 a.m. OK Java 8 TESTS 41 139 0
72648591 Java B March 7, 2020, 10:44 a.m. OK Java 8 TESTS 41 140 0
72635870 koboshi B March 7, 2020, 9:55 a.m. OK Kotlin TESTS 41 155 0
72671299 Spheniscine B March 7, 2020, 2:56 p.m. OK Kotlin TESTS 41 170 102400
72639972 Spheniscine B March 7, 2020, 10:10 a.m. OK Kotlin TESTS 41 171 307200
72645181 Hakiobo B March 7, 2020, 10:30 a.m. OK Kotlin TESTS 41 187 512000
72640469 Schacher97 B March 7, 2020, 10:12 a.m. OK Kotlin TESTS 41 233 716800
72662982 sergmel B March 7, 2020, 12:49 p.m. OK Mono C# TESTS 41 78 7270400
72636878 mban259 B March 7, 2020, 9:59 a.m. OK Mono C# TESTS 41 93 7884800
72681690 Anastasiya_Andreevna B March 7, 2020, 5:36 p.m. OK Mono C# TESTS 41 280 7168000
72649941 dacc B March 7, 2020, 10:51 a.m. OK MS C++ TESTS 41 46 1433600
72641342 Flighter B March 7, 2020, 10:15 a.m. OK MS C++ TESTS 41 62 0
72644283 wawahaha B March 7, 2020, 10:27 a.m. OK MS C++ TESTS 41 62 307200
72650224 fucking_man B March 7, 2020, 10:52 a.m. OK MS C++ TESTS 41 77 1638400
72666435 gjdms611 B March 7, 2020, 1:39 p.m. OK MS C++ 2017 TESTS 41 46 102400
72635938 kim_young_hyun B March 7, 2020, 9:56 a.m. OK MS C++ 2017 TESTS 41 46 614400
72653567 shon804 B March 7, 2020, 11:08 a.m. OK MS C++ 2017 TESTS 41 46 1331200
72649683 qwe123rt45 B March 7, 2020, 10:50 a.m. OK MS C++ 2017 TESTS 41 46 1331200
72700075 wjsrptmd B March 8, 2020, 3:07 a.m. OK MS C++ 2017 TESTS 41 46 1843200
72655848 LeeLdler B March 7, 2020, 11:20 a.m. OK MS C++ 2017 TESTS 41 46 10444800
72689950 seoungjun B March 7, 2020, 8:25 p.m. OK MS C++ 2017 TESTS 41 62 921600
72637028 Naumtsev B March 7, 2020, 9:59 a.m. OK MS C++ 2017 TESTS 41 62 1536000
72648493 letsolum B March 7, 2020, 10:44 a.m. OK MS C++ 2017 TESTS 41 62 1843200
72691070 salehsargolzaee B March 7, 2020, 8:55 p.m. OK MS C++ 2017 TESTS 41 62 6451200
72668812 Shik B March 7, 2020, 2:14 p.m. OK Node.js TESTS 41 233 5120000
72645428 deskata1997 B March 7, 2020, 10:31 a.m. OK Node.js TESTS 41 249 5836800
72645836 tkain B March 7, 2020, 10:33 a.m. OK Node.js TESTS 41 265 10240000
72678405 raj1307 B March 7, 2020, 5 p.m. OK PyPy 2 TESTS 41 187 9625600
72641796 raj1307 B March 7, 2020, 10:17 a.m. OK PyPy 2 TESTS 41 202 9625600
72678446 raj1307 B March 7, 2020, 5 p.m. OK PyPy 2 TESTS 41 217 10547200
72652549 yamatoumi B March 7, 2020, 11:03 a.m. OK PyPy 2 TESTS 41 265 3686400
72637065 rkstalker B March 7, 2020, 10 a.m. OK PyPy 2 TESTS 41 873 4710400
72665203 Tao-Cheng B March 7, 2020, 1:20 p.m. OK PyPy 3 TESTS 41 186 5324800
72650735 qwertz73355a B March 7, 2020, 10:54 a.m. OK PyPy 3 TESTS 41 186 5529600
72636300 Shee11 B March 7, 2020, 9:57 a.m. OK PyPy 3 TESTS 41 186 6041600
72662244 510030805voidf B March 7, 2020, 12:39 p.m. OK PyPy 3 TESTS 41 187 5120000
72638746 wilkinson B March 7, 2020, 10:06 a.m. OK PyPy 3 TESTS 41 187 5529600
72645290 sangonana B March 7, 2020, 10:31 a.m. OK PyPy 3 TESTS 41 187 5836800
72675798 dannyboy20031204 B March 7, 2020, 4:15 p.m. OK PyPy 3 TESTS 41 187 5939200
72648617 Tsubo_ B March 7, 2020, 10:44 a.m. OK PyPy 3 TESTS 41 187 6144000
72637655 nagitaosu B March 7, 2020, 10:02 a.m. OK PyPy 3 TESTS 41 187 6860800
72647127 youness.amhaouch B March 7, 2020, 10:38 a.m. OK PyPy 3 TESTS 41 187 7065600
72656871 hooded_sweater B March 7, 2020, 11:25 a.m. OK Python 2 TESTS 41 265 4096000
72695909 essi B March 7, 2020, 11:31 p.m. OK Python 3 TESTS 41 155 1024000
72641353 vadym_doroshenko B March 7, 2020, 10:16 a.m. OK Python 3 TESTS 41 155 1331200
72644065 YashShah B March 7, 2020, 10:26 a.m. OK Python 3 TESTS 41 156 2662400
72643769 ryo_n B March 7, 2020, 10:25 a.m. OK Python 3 TESTS 41 171 1228800
72657577 kn0412 B March 7, 2020, 11:29 a.m. OK Python 3 TESTS 41 171 1433600
72654241 vvilna B March 7, 2020, 11:12 a.m. OK Python 3 TESTS 41 171 1536000
72687376 Gaurav1 B March 7, 2020, 7:29 p.m. OK Python 3 TESTS 41 171 2764800
72649802 tolytrader B March 7, 2020, 10:50 a.m. OK Python 3 TESTS 41 171 2867200
72646006 _SmallY B March 7, 2020, 10:33 a.m. OK Python 3 TESTS 41 187 2662400
72662638 shivam_hbtu B March 7, 2020, 12:44 p.m. OK Python 3 TESTS 41 187 6144000
72640509 cympfh B March 7, 2020, 10:12 a.m. OK Rust TESTS 41 46 2252800
72636054 terraformer B March 7, 2020, 9:56 a.m. OK Rust TESTS 41 46 2560000
72643805 akiradeveloper B March 7, 2020, 10:25 a.m. OK Rust TESTS 41 46 2969600
72664658 rustafarian B March 7, 2020, 1:13 p.m. OK Rust TESTS 41 46 3379200
72655018 rustafarian B March 7, 2020, 11:16 a.m. OK Rust TESTS 41 46 3379200

remove filters

Back to search problems