Codeforces Global Round 6

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
1266 Codeforces Global Round 6 FINISHED False 9000 155228099 Dec. 17, 2019, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9724 ) C Diverse Matrix PROGRAMMING constructive algorithms greedy math number theory 1400

B'Let a be a matrix of size r x c containing positive integers, not necessarily distinct. Rows of the matrix are numbered from 1 to r , columns are numbered from 1 to c . We can construct an array b consisting of r + c integers as follows: for each i in [1, r] , let b_i be the greatest common divisor of integers in the i -th row, and for each j in [1, c] let b_{r+j} be the greatest common divisor of integers in the j -th column. We call the matrix diverse if all r + c numbers b_k ( k in [1, r + c] ) are pairwise distinct. The magnitude of a matrix equals to the maximum of b_k . For example, suppose we have the following matrix: We construct the array b : So b = [1, 4, 2, 9, 7] . All values in this array are distinct, so the matrix is diverse. The magnitude is equal to 9 . For a given r and c , find a diverse matrix that minimises the magnitude. If there are multiple solutions, you may output any of them. If there are no solutions, output a single integer 0 . The only line in the input contains two space separated integers r and c ( 1 <= q r,c <= q 500 ) -- the number of rows and the number of columns of the matrix to be found. If there is no solution, output a single integer 0 . Otherwise, output r rows. The i -th of them should contain c space-separated integers, the j -th of which is a_{i,j} -- the positive integer in the i -th row and j -th column of a diverse matrix minimizing the magnitude. Furthermore, it must hold that 1 <= q a_{i,j} <= q 10^9 . It can be shown that if a solution exists, there is also a solution with this additional constraint (still having minimum possible magnitude). In the first example, the GCDs of rows are b_1 = 4 and b_2 = 1 , and the GCDs of columns are b_3 = 2 and b_4 = 3 . All GCDs are pairwise dist'...

Tutorials

Codeforces Global Round 6 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
67471936 will_of_ken C Dec. 23, 2019, 1:06 p.m. OK Clang++17 Diagnostics TESTS 31 826 3072000 1400
67091791 Gassa C Dec. 17, 2019, 3:36 p.m. OK D TESTS 31 62 4300800 1400
67084407 iica C Dec. 17, 2019, 3:21 p.m. OK D TESTS 31 93 11878400 1400
67109179 daut-dlang C Dec. 17, 2019, 4:37 p.m. OK D TESTS 31 109 11878400 1400
67095008 fluffyowl C Dec. 17, 2019, 3:45 p.m. OK D TESTS 31 124 11878400 1400
67082623 hos.lyric C Dec. 17, 2019, 3:18 p.m. OK D TESTS 31 155 4198400 1400
67096875 ruban C Dec. 17, 2019, 3:50 p.m. OK Delphi TESTS 31 77 63180800 1400
67105347 LaSWeeG C Dec. 17, 2019, 4:20 p.m. OK FPC TESTS 31 748 2048000 1400
67103185 Dbvivi C Dec. 17, 2019, 4:11 p.m. OK FPC TESTS 31 763 7987200 1400
67168427 kaiboy C Dec. 18, 2019, 4:23 p.m. OK GNU C11 TESTS 31 826 0 1400
68314325 ratul_supertramp C Jan. 6, 2020, 12:37 p.m. OK GNU C11 TESTS 31 826 1024000 1400
68314314 vjudge5 C Jan. 6, 2020, 12:37 p.m. OK GNU C11 TESTS 31 826 1024000 1400
67132974 mth1908 C Dec. 18, 2019, 1:44 a.m. OK GNU C11 TESTS 31 826 1024000 1400
67117221 cc0408 C Dec. 17, 2019, 5:23 p.m. OK GNU C11 TESTS 31 841 0 1400
67123274 Rahimmia C Dec. 17, 2019, 6:59 p.m. OK GNU C11 TESTS 31 841 0 1400
68106767 akash19jain C Jan. 3, 2020, 7:30 a.m. OK GNU C11 TESTS 31 841 0 1400
67109630 Abdulaziz_Kazim C Dec. 17, 2019, 4:39 p.m. OK GNU C11 TESTS 31 841 1024000 1400
67463661 rahulgoel C Dec. 23, 2019, 10:12 a.m. OK GNU C11 TESTS 31 841 1024000 1400
67097355 Chipe1 C Dec. 17, 2019, 3:52 p.m. OK GNU C11 TESTS 31 841 1024000 1400
67087535 memset0c C Dec. 17, 2019, 3:27 p.m. OK GNU C++11 TESTS 31 31 0 1400
67143478 LengYun C Dec. 18, 2019, 7:49 a.m. OK GNU C++11 TESTS 31 31 0 1400
67084036 LJC00118 C Dec. 17, 2019, 3:21 p.m. OK GNU C++11 TESTS 31 31 1024000 1400
67080980 1919810 C Dec. 17, 2019, 3:15 p.m. OK GNU C++11 TESTS 31 31 1024000 1400
68329177 luogu_bot4 C Jan. 6, 2020, 6:02 p.m. OK GNU C++11 TESTS 31 46 0 1400
67762525 huanggs C Dec. 28, 2019, 12:08 a.m. OK GNU C++11 TESTS 31 46 1024000 1400
67629407 yuzhechuan C Dec. 26, 2019, 2:15 a.m. OK GNU C++11 TESTS 31 46 1024000 1400
67086316 lk_ZeroMaker C Dec. 17, 2019, 3:25 p.m. OK GNU C++11 TESTS 31 46 5836800 1400
67470461 redegg C Dec. 23, 2019, 12:37 p.m. OK GNU C++11 TESTS 31 61 0 1400
68891470 beacon_cwk C Jan. 16, 2020, 2:30 a.m. OK GNU C++11 TESTS 31 61 0 1400
67136450 kawai_0v0_ C Dec. 18, 2019, 4:32 a.m. OK GNU C++14 TESTS 31 31 3993600 1400
68005005 Luzivanlt C Dec. 31, 2019, 12:46 p.m. OK GNU C++14 TESTS 31 46 0 1400
69218835 ver_y007 C Jan. 21, 2020, 3:07 a.m. OK GNU C++14 TESTS 31 46 0 1400
68673911 vjudge5 C Jan. 12, 2020, 5:47 p.m. OK GNU C++14 TESTS 31 46 0 1400
68481140 planegoose C Jan. 10, 2020, 7:47 a.m. OK GNU C++14 TESTS 31 46 0 1400
68134171 Sabamak C Jan. 3, 2020, 6:07 p.m. OK GNU C++14 TESTS 31 46 0 1400
68032648 Dilemma27 C Jan. 1, 2020, 10:12 a.m. OK GNU C++14 TESTS 31 46 0 1400
68004301 harshkhanna C Dec. 31, 2019, 12:25 p.m. OK GNU C++14 TESTS 31 46 0 1400
67870443 VLADO C Dec. 29, 2019, 11:15 a.m. OK GNU C++14 TESTS 31 46 0 1400
67455908 Sarthak308 C Dec. 23, 2019, 6:52 a.m. OK GNU C++14 TESTS 31 46 0 1400
67781279 ahzong C Dec. 28, 2019, 11:03 a.m. OK GNU C++17 TESTS 31 46 0 1400
67984514 MHD_Ala C Dec. 30, 2019, 9:22 p.m. OK GNU C++17 TESTS 31 46 0 1400
67984584 MHD_Ala C Dec. 30, 2019, 9:25 p.m. OK GNU C++17 TESTS 31 46 0 1400
67991693 ekansh_01 C Dec. 31, 2019, 5:25 a.m. OK GNU C++17 TESTS 31 46 0 1400
68287024 kirboy C Jan. 5, 2020, 6:57 p.m. OK GNU C++17 TESTS 31 46 0 1400
68299417 Koo_ C Jan. 6, 2020, 5:38 a.m. OK GNU C++17 TESTS 31 46 0 1400
68355615 popovicirobert C Jan. 7, 2020, 11:57 a.m. OK GNU C++17 TESTS 31 46 0 1400
69193199 Danzzle C Jan. 20, 2020, 2:07 p.m. OK GNU C++17 TESTS 31 46 0 1400
69479102 shay__ C Jan. 24, 2020, 5:08 p.m. OK GNU C++17 TESTS 31 46 0 1400
69495199 joylintp C Jan. 25, 2020, 3:18 a.m. OK GNU C++17 TESTS 31 46 0 1400
67099120 caidodo0_0 C Dec. 17, 2019, 3:57 p.m. OK Go TESTS 31 77 0 1400
67115762 Aidar.Babanov C Dec. 17, 2019, 5:14 p.m. OK Go TESTS 31 889 0 1400
67182974 Russell_Emerine C Dec. 19, 2019, 1:47 a.m. OK Haskell TESTS 31 77 102400 1400
67096594 Musin C Dec. 17, 2019, 3:49 p.m. OK Java 11 TESTS 31 202 0 1400
67348997 akifpathan C Dec. 21, 2019, 11:56 a.m. OK Java 11 TESTS 31 217 0 1400
68453102 TheSawan C Jan. 9, 2020, 3:04 p.m. OK Java 11 TESTS 31 218 0 1400
67874111 serafimkoo C Dec. 29, 2019, 12:38 p.m. OK Java 11 TESTS 31 218 0 1400
67150980 darshancool25 C Dec. 18, 2019, 10:46 a.m. OK Java 11 TESTS 31 218 0 1400
68099054 Anonymous C Jan. 3, 2020, 12:11 a.m. OK Java 11 TESTS 31 233 0 1400
67156700 ankyy_0103 C Dec. 18, 2019, 12:43 p.m. OK Java 11 TESTS 31 234 0 1400
67096696 machhra C Dec. 17, 2019, 3:50 p.m. OK Java 11 TESTS 31 248 0 1400
67121526 Dukkha C Dec. 17, 2019, 6:29 p.m. OK Java 11 TESTS 31 249 0 1400
67100935 vaibhavpulastya C Dec. 17, 2019, 4:03 p.m. OK Java 11 TESTS 31 249 0 1400
67124111 an09mous C Dec. 17, 2019, 7:17 p.m. OK Java 8 TESTS 31 124 0 1400
67114187 neo4104 C Dec. 17, 2019, 5:04 p.m. OK Java 8 TESTS 31 124 0 1400
67093128 StayAwayFromBitches C Dec. 17, 2019, 3:40 p.m. OK Java 8 TESTS 31 124 0 1400
67489299 af_saif C Dec. 23, 2019, 6:43 p.m. OK Java 8 TESTS 31 124 5017600 1400
67095430 bhavyashah9873 C Dec. 17, 2019, 3:46 p.m. OK Java 8 TESTS 31 139 0 1400
67108305 rwali C Dec. 17, 2019, 4:33 p.m. OK Java 8 TESTS 31 139 0 1400
67106844 Desert C Dec. 17, 2019, 4:26 p.m. OK Java 8 TESTS 31 139 0 1400
67099582 procrastinate7 C Dec. 17, 2019, 3:58 p.m. OK Java 8 TESTS 31 139 0 1400
67087443 uwi C Dec. 17, 2019, 3:27 p.m. OK Java 8 TESTS 31 139 0 1400
67444900 garg_vibhor C Dec. 22, 2019, 9:27 p.m. OK Java 8 TESTS 31 140 0 1400
67114858 Differum C Dec. 17, 2019, 5:08 p.m. OK Kotlin TESTS 31 155 4915200 1400
67129654 Tlatoani C Dec. 17, 2019, 10:27 p.m. OK Kotlin TESTS 31 170 4710400 1400
67135297 Spheniscine C Dec. 18, 2019, 3:45 a.m. OK Kotlin TESTS 31 171 512000 1400
67115992 AsuraPro C Dec. 17, 2019, 5:15 p.m. OK Kotlin TESTS 31 186 204800 1400
67629989 camypaper C Dec. 26, 2019, 3:02 a.m. OK Mono C# TESTS 31 93 57344000 1400
67095355 tomomo2b2 C Dec. 17, 2019, 3:46 p.m. OK Mono C# TESTS 31 109 6758400 1400
67104041 sergmel C Dec. 17, 2019, 4:14 p.m. OK Mono C# TESTS 31 109 16588800 1400
67102184 AndrejevVE C Dec. 17, 2019, 4:07 p.m. OK Mono C# TESTS 31 124 6860800 1400
67101255 mban259 C Dec. 17, 2019, 4:04 p.m. OK Mono C# TESTS 31 124 12902400 1400
67089088 keymoon C Dec. 17, 2019, 3:30 p.m. OK Mono C# TESTS 31 124 17715200 1400
67095969 Yupiteru C Dec. 17, 2019, 3:48 p.m. OK Mono C# TESTS 31 124 143155200 1400
67095758 eki C Dec. 17, 2019, 3:47 p.m. OK Mono C# TESTS 31 826 3993600 1400
67207956 vjudge2 C Dec. 19, 2019, 1:05 p.m. OK MS C++ TESTS 31 61 0 1400
67195392 platter C Dec. 19, 2019, 8:49 a.m. OK MS C++ TESTS 31 62 2048000 1400
67095181 tarattata1 C Dec. 17, 2019, 3:45 p.m. OK MS C++ TESTS 31 77 0 1400
67092608 math957963 C Dec. 17, 2019, 3:39 p.m. OK MS C++ TESTS 31 93 0 1400
68703166 vjudge2 C Jan. 13, 2020, 10:11 a.m. OK MS C++ TESTS 31 124 2048000 1400
69083689 vjudge1 C Jan. 19, 2020, 7:28 a.m. OK MS C++ TESTS 31 139 0 1400
67090231 youx C Dec. 17, 2019, 3:33 p.m. OK MS C++ 2017 TESTS 31 77 0 1400
67091873 nukeykt C Dec. 17, 2019, 3:37 p.m. OK MS C++ 2017 TESTS 31 77 0 1400
67085247 pichulia C Dec. 17, 2019, 3:23 p.m. OK MS C++ 2017 TESTS 31 78 0 1400
68704039 vjudge3 C Jan. 13, 2020, 10:32 a.m. OK MS C++ 2017 TESTS 31 78 0 1400
67268308 AleksanderBalobanov C Dec. 20, 2019, 7:06 a.m. OK MS C++ 2017 TESTS 31 78 0 1400
67121858 Tangerine C Dec. 17, 2019, 6:34 p.m. OK MS C++ 2017 TESTS 31 78 0 1400
67095457 dkyun C Dec. 17, 2019, 3:46 p.m. OK MS C++ 2017 TESTS 31 93 0 1400
67101853 ningBr C Dec. 17, 2019, 4:06 p.m. OK MS C++ 2017 TESTS 31 93 0 1400
67101328 Schullz C Dec. 17, 2019, 4:04 p.m. OK MS C++ 2017 TESTS 31 93 3891200 1400
67108436 Ivan11 C Dec. 17, 2019, 4:33 p.m. OK MS C++ 2017 TESTS 31 108 1024000 1400
67103711 shivam1420 C Dec. 17, 2019, 4:13 p.m. OK Node.js TESTS 31 233 14028800 1400
67092616 MVP C Dec. 17, 2019, 3:39 p.m. OK PyPy 2 TESTS 31 155 1740800 1400
67097026 Mukundan314 C Dec. 17, 2019, 3:51 p.m. OK PyPy 2 TESTS 31 155 4710400 1400
67088544 bcollet C Dec. 17, 2019, 3:29 p.m. OK PyPy 2 TESTS 31 155 8294400 1400
68035709 raj1307 C Jan. 1, 2020, 11:54 a.m. OK PyPy 2 TESTS 31 171 6553600 1400
67142370 iamprayush C Dec. 18, 2019, 7:21 a.m. OK PyPy 2 TESTS 31 171 6758400 1400
67093873 pajenegod C Dec. 17, 2019, 3:42 p.m. OK PyPy 2 TESTS 31 171 8601600 1400
67089368 alexwice C Dec. 17, 2019, 3:31 p.m. OK PyPy 2 TESTS 31 186 2150400 1400
67102178 parasmehan123 C Dec. 17, 2019, 4:07 p.m. OK PyPy 2 TESTS 31 186 3788800 1400
67105731 Pyar.Mahobat.Dhoka.Hai C Dec. 17, 2019, 4:21 p.m. OK PyPy 2 TESTS 31 186 6451200 1400
67103341 shehebe C Dec. 17, 2019, 4:12 p.m. OK PyPy 2 TESTS 31 327 8704000 1400
67192205 IrOty1oX5uSp4 C Dec. 19, 2019, 7:33 a.m. OK PyPy 3 TESTS 31 186 8192000 1400
67104161 Myao C Dec. 17, 2019, 4:15 p.m. OK PyPy 3 TESTS 31 264 3686400 1400
67191558 vaibhavsingh100070 C Dec. 19, 2019, 7:17 a.m. OK PyPy 3 TESTS 31 264 4710400 1400
68955096 only_bruteforce C Jan. 16, 2020, 7:43 p.m. OK PyPy 3 TESTS 31 264 4812800 1400
67102549 Tihohon C Dec. 17, 2019, 4:09 p.m. OK PyPy 3 TESTS 31 265 4300800 1400
67108075 twbbbb C Dec. 17, 2019, 4:32 p.m. OK PyPy 3 TESTS 31 265 4403200 1400
68095865 SinKing C Jan. 2, 2020, 8:43 p.m. OK PyPy 3 TESTS 31 265 4710400 1400
67272506 jasonsebastian C Dec. 20, 2019, 8:52 a.m. OK PyPy 3 TESTS 31 265 4710400 1400
67101598 crypticcoder C Dec. 17, 2019, 4:05 p.m. OK PyPy 3 TESTS 31 280 3276800 1400
67093986 sempav C Dec. 17, 2019, 3:42 p.m. OK PyPy 3 TESTS 31 280 3686400 1400
67458231 SoSooding C Dec. 23, 2019, 7:59 a.m. OK Python 2 TESTS 31 280 0 1400
67109924 ashu249 C Dec. 17, 2019, 4:41 p.m. OK Python 2 TESTS 31 342 4608000 1400
67088169 nwi C Dec. 17, 2019, 3:28 p.m. OK Python 2 TESTS 31 436 6451200 1400
68334271 nealzane C Jan. 6, 2020, 8:33 p.m. OK Python 3 TESTS 31 186 102400 1400
67095099 Shee11 C Dec. 17, 2019, 3:45 p.m. OK Python 3 TESTS 31 202 102400 1400
67099276 coderbd C Dec. 17, 2019, 3:57 p.m. OK Python 3 TESTS 31 233 102400 1400
67098232 BratAhmet C Dec. 17, 2019, 3:54 p.m. OK Python 3 TESTS 31 233 102400 1400
67109904 pratikg1999 C Dec. 17, 2019, 4:40 p.m. OK Python 3 TESTS 31 249 0 1400
67112981 dumbass93 C Dec. 17, 2019, 4:57 p.m. OK Python 3 TESTS 31 249 1228800 1400
67101945 nrvft C Dec. 17, 2019, 4:06 p.m. OK Python 3 TESTS 31 249 5427200 1400
67107422 shittttyyyyyy C Dec. 17, 2019, 4:29 p.m. OK Python 3 TESTS 31 249 5836800 1400
67125393 ostroumov C Dec. 17, 2019, 7:51 p.m. OK Python 3 TESTS 31 265 5836800 1400
67125018 3x7 C Dec. 17, 2019, 7:40 p.m. OK Python 3 TESTS 31 295 6041600 1400
67087225 tuna_salad C Dec. 17, 2019, 3:26 p.m. OK Rust TESTS 31 62 0 1400
67097539 sansen C Dec. 17, 2019, 3:52 p.m. OK Rust TESTS 31 62 4710400 1400
67106732 manta1130 C Dec. 17, 2019, 4:26 p.m. OK Rust TESTS 31 93 1126400 1400
67133824 kobae964 C Dec. 18, 2019, 2:33 a.m. OK Rust TESTS 31 109 1331200 1400

remove filters

Back to search problems