Codeforces Round 630 (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
1332 Codeforces Round 630 (Div. 2) FINISHED False 9000 151691111 March 31, 2020, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 17850 ) B Composite Coloring PROGRAMMING brute force constructive algorithms greedy math number theory 1500

B"A positive integer is called composite if it can be represented as a product of two positive integers, both greater than 1 . For example, the following numbers are composite: 6 , 4 , 120 , 27 . The following numbers aren't: 1 , 2 , 3 , 17 , 97 . Alice is given a sequence of n composite numbers a_1,a_2, ldots,a_n . She wants to choose an integer m <= 11 and color each element one of m colors from 1 to m so that: Note that equal elements can be colored different colors -- you just have to choose one of m colors for each of the indices from 1 to n . Alice showed already that if all a_i <= 1000 then she can always solve the task by choosing some m <= 11 . Help Alice to find the required coloring. Note that you don't have to minimize or maximize the number of colors, you just have to find the solution with some m from 1 to 11 . The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. Then the descriptions of the test cases follow. The first line of the test case contains a single integer n ( 1 <= n <= 1000 ) -- the amount of numbers in a sequence a . The second line of the test case contains n composite integers a_1,a_2, ldots,a_n ( 4 <= a_i <= 1000 ). It is guaranteed that the sum of n over all test cases doesn't exceed 10^4 . For each test case print 2 lines. The first line should contain a single integer m ( 1 <= m <= 11 ) -- the number of used colors. Consider colors to be numbered from 1 to m . The second line should contain any coloring that satisfies the above conditions. Print n integers c_1, c_2, ... , c_n ( 1 <= c_i <= m ), where c_i is the color of the i -th element. If there are multiple solutions then you can print any of them. Note that you don't have to minimize "...

Tutorials

Codeforces Round #630 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
75423592 pastafaryan B April 3, 2020, 6:16 p.m. OK Clang++17 Diagnostics TESTS 19 124 102400 1500
75790496 ruihd B April 7, 2020, 10:49 p.m. OK Clang++17 Diagnostics TESTS 19 124 12595200 1500
75143988 Madalina_Chirpicinic B April 1, 2020, 3:47 p.m. OK FPC TESTS 19 62 0 1500
75187084 JoseTomas01 B April 1, 2020, 10:46 p.m. OK GNU C11 TESTS 19 46 0 1500
74998888 hscpy B March 31, 2020, 5:03 p.m. OK GNU C11 TESTS 19 46 0 1500
75021936 kartik_2907 B March 31, 2020, 9:23 p.m. OK GNU C11 TESTS 19 46 204800 1500
75056997 huang_c_c B April 1, 2020, 8:32 a.m. OK GNU C11 TESTS 19 46 307200 1500
75021852 kartik_2907 B March 31, 2020, 9:21 p.m. OK GNU C11 TESTS 19 61 204800 1500
75039074 UshanGhosh B April 1, 2020, 4:46 a.m. OK GNU C11 TESTS 19 61 204800 1500
75879219 lifers B April 8, 2020, 3:25 p.m. OK GNU C11 TESTS 19 62 0 1500
75755141 akash19jain B April 7, 2020, 2:35 p.m. OK GNU C11 TESTS 19 62 0 1500
76034524 ARSLANNN B April 9, 2020, 7:56 p.m. OK GNU C11 TESTS 19 62 0 1500
75988459 Sagar3745 B April 9, 2020, 12:16 p.m. OK GNU C11 TESTS 19 62 0 1500
75704861 woshimolei B April 7, 2020, 1:37 a.m. OK GNU C++11 TESTS 19 15 0 1500
75032924 shuitiangong B April 1, 2020, 2:35 a.m. OK GNU C++11 TESTS 19 15 307200 1500
75553043 zyr17 B April 5, 2020, 9:30 a.m. OK GNU C++11 TESTS 19 15 716800 1500
75844554 GpHss B April 8, 2020, 2:33 p.m. OK GNU C++11 TESTS 19 30 0 1500
75421018 ozAslan B April 3, 2020, 5:55 p.m. OK GNU C++11 TESTS 19 30 0 1500
75253667 vjudge4 B April 2, 2020, 2:48 p.m. OK GNU C++11 TESTS 19 30 0 1500
75030246 Heisexingqitian B April 1, 2020, 1:18 a.m. OK GNU C++11 TESTS 19 30 0 1500
74992375 JeraldyMazaingo B March 31, 2020, 3:57 p.m. OK GNU C++11 TESTS 19 30 0 1500
74989033 HSJHSJ B March 31, 2020, 3:48 p.m. OK GNU C++11 TESTS 19 30 0 1500
74980069 czjxyz B March 31, 2020, 3:22 p.m. OK GNU C++11 TESTS 19 30 0 1500
75317993 sam_khan99 B April 3, 2020, 7:15 a.m. OK GNU C++14 TESTS 19 15 0 1500
75208056 uacoder123 B April 2, 2020, 6:34 a.m. OK GNU C++14 TESTS 19 15 0 1500
75061856 vjudge5 B April 1, 2020, 9:28 a.m. OK GNU C++14 TESTS 19 15 0 1500
75053586 vinayakkatoch83 B April 1, 2020, 7:51 a.m. OK GNU C++14 TESTS 19 15 0 1500
75047023 trouble... B April 1, 2020, 6:37 a.m. OK GNU C++14 TESTS 19 15 0 1500
75026082 sahuash017 B March 31, 2020, 11:11 p.m. OK GNU C++14 TESTS 19 15 0 1500
75021019 swayam811 B March 31, 2020, 9:05 p.m. OK GNU C++14 TESTS 19 15 0 1500
75324997 Deadshot007 B April 3, 2020, 8:55 a.m. OK GNU C++14 TESTS 19 15 0 1500
75808214 MaJorie B April 8, 2020, 6:42 a.m. OK GNU C++14 TESTS 19 15 0 1500
75991028 anuragtrip_123 B April 9, 2020, 12:44 p.m. OK GNU C++14 TESTS 19 15 0 1500
75052787 Mukhitali B April 1, 2020, 7:42 a.m. OK GNU C++17 TESTS 19 15 0 1500
75069337 SummerMing B April 1, 2020, 10:47 a.m. OK GNU C++17 TESTS 19 15 0 1500
75195582 Huangzzzzz B April 2, 2020, 3:15 a.m. OK GNU C++17 TESTS 19 15 0 1500
75014964 saynaaa B March 31, 2020, 7:28 p.m. OK GNU C++17 TESTS 19 15 0 1500
75025422 Geothermal B March 31, 2020, 10:49 p.m. OK GNU C++17 TESTS 19 15 0 1500
75028893 vjudge5 B April 1, 2020, 12:38 a.m. OK GNU C++17 TESTS 19 15 0 1500
75051808 namquan B April 1, 2020, 7:30 a.m. OK GNU C++17 TESTS 19 15 0 1500
74988748 PETER666 B March 31, 2020, 3:47 p.m. OK GNU C++17 TESTS 19 15 0 1500
74980167 s1mple_ B March 31, 2020, 3:22 p.m. OK GNU C++17 TESTS 19 15 0 1500
75754835 suryakamalog B April 7, 2020, 2:32 p.m. OK GNU C++17 TESTS 19 15 204800 1500
75618222 kort0n B April 6, 2020, 2:45 a.m. OK GNU C++17 (64) TESTS 19 15 0 1500
76430443 Akulyat B April 12, 2020, 9:08 p.m. OK GNU C++17 (64) TESTS 19 15 0 1500
75020388 essi B March 31, 2020, 8:52 p.m. OK GNU C++17 (64) TESTS 19 15 0 1500
74991753 sustech_plus B March 31, 2020, 3:55 p.m. OK GNU C++17 (64) TESTS 19 15 0 1500
74987940 conquizztador B March 31, 2020, 3:44 p.m. OK GNU C++17 (64) TESTS 19 15 0 1500
75002820 MZuenni B March 31, 2020, 5:33 p.m. OK GNU C++17 (64) TESTS 19 15 102400 1500
75045220 sharrad99 B April 1, 2020, 6:14 a.m. OK GNU C++17 (64) TESTS 19 30 0 1500
75055800 sugarrr B April 1, 2020, 8:18 a.m. OK GNU C++17 (64) TESTS 19 30 0 1500
75277252 MatsuTaku B April 2, 2020, 6:17 p.m. OK GNU C++17 (64) TESTS 19 30 0 1500
75348411 ANAMiya.wanted B April 3, 2020, 1:38 p.m. OK GNU C++17 (64) TESTS 19 30 0 1500
75060462 synapse B April 1, 2020, 9:12 a.m. OK Go TESTS 19 31 0 1500
75778896 justplesh B April 7, 2020, 7:05 p.m. OK Go TESTS 19 46 0 1500
75029334 pohzipohzi B April 1, 2020, 12:51 a.m. OK Go TESTS 19 46 102400 1500
75020065 Asgar B March 31, 2020, 8:46 p.m. OK Go TESTS 19 217 4608000 1500
75615387 Russell_Emerine B April 6, 2020, 1:03 a.m. OK Haskell TESTS 19 46 102400 1500
75002071 Moonlit B March 31, 2020, 5:27 p.m. OK Java 11 TESTS 19 187 0 1500
74999339 sarthakmanna B March 31, 2020, 5:06 p.m. OK Java 11 TESTS 19 187 614400 1500
76291476 nelo_angelo_54 B April 12, 2020, 6:05 a.m. OK Java 11 TESTS 19 202 0 1500
76047706 sajith B April 10, 2020, 1:22 a.m. OK Java 11 TESTS 19 202 0 1500
75712832 alankritanand001 B April 7, 2020, 5:17 a.m. OK Java 11 TESTS 19 202 0 1500
75064375 Laxmikant.Katre B April 1, 2020, 9:54 a.m. OK Java 11 TESTS 19 202 0 1500
75053829 devesh08 B April 1, 2020, 7:54 a.m. OK Java 11 TESTS 19 202 0 1500
75050931 kraken7 B April 1, 2020, 7:20 a.m. OK Java 11 TESTS 19 202 0 1500
75034098 anhpp B April 1, 2020, 3:03 a.m. OK Java 11 TESTS 19 202 0 1500
75005351 Clowyy B March 31, 2020, 5:57 p.m. OK Java 11 TESTS 19 202 0 1500
75467437 NalinTiwary B April 4, 2020, 8:25 a.m. OK Java 8 TESTS 19 109 0 1500
76324743 marcose18 B April 12, 2020, 12:32 p.m. OK Java 8 TESTS 19 109 0 1500
75229971 jakejase2 B April 2, 2020, 11:08 a.m. OK Java 8 TESTS 19 109 0 1500
75217807 ineffablekenobi B April 2, 2020, 8:41 a.m. OK Java 8 TESTS 19 109 0 1500
75173306 altynbek.nurgaziyev B April 1, 2020, 6:54 p.m. OK Java 8 TESTS 19 109 0 1500
75072755 nalin_1000101 B April 1, 2020, 11:23 a.m. OK Java 8 TESTS 19 109 0 1500
75029299 bluesky111 B April 1, 2020, 12:50 a.m. OK Java 8 TESTS 19 109 0 1500
75024141 pramit1998 B March 31, 2020, 10:14 p.m. OK Java 8 TESTS 19 109 0 1500
75010159 prem_cse B March 31, 2020, 6:27 p.m. OK Java 8 TESTS 19 109 0 1500
74985911 Charlesna B March 31, 2020, 3:38 p.m. OK Java 8 TESTS 19 109 0 1500
75014273 rndg B March 31, 2020, 7:19 p.m. OK JavaScript TESTS 19 62 2048000 1500
75492124 yevhenii_kanivets B April 4, 2020, 2:07 p.m. OK Kotlin TESTS 19 155 1638400 1500
75058439 Spheniscine B April 1, 2020, 8:50 a.m. OK Kotlin TESTS 19 156 1740800 1500
75083050 bohuss B April 1, 2020, 1:13 p.m. OK Kotlin TESTS 19 202 1843200 1500
75006118 dkozak94 B March 31, 2020, 6:05 p.m. OK Kotlin TESTS 19 202 2048000 1500
74990539 abdukodir B March 31, 2020, 3:52 p.m. OK Kotlin TESTS 19 202 2048000 1500
76018695 NotEvenWrong B April 9, 2020, 5:07 p.m. OK MS C++ TESTS 19 31 0 1500
75810721 Randolph_ B April 8, 2020, 7:17 a.m. OK MS C++ TESTS 19 31 0 1500
75042066 seh631638554 B April 1, 2020, 5:34 a.m. OK MS C++ TESTS 19 31 0 1500
75031316 vjudge5 B April 1, 2020, 1:50 a.m. OK MS C++ TESTS 19 31 0 1500
75036644 vjudge2 B April 1, 2020, 4 a.m. OK MS C++ TESTS 19 31 409600 1500
75146771 vjudge1 B April 1, 2020, 3:54 p.m. OK MS C++ TESTS 19 46 0 1500
75146768 vjudge4 B April 1, 2020, 3:54 p.m. OK MS C++ TESTS 19 46 0 1500
75053781 vjudge5 B April 1, 2020, 7:54 a.m. OK MS C++ TESTS 19 46 0 1500
75026987 flypbird B March 31, 2020, 11:40 p.m. OK MS C++ TESTS 19 46 0 1500
75003492 New_Totoro B March 31, 2020, 5:39 p.m. OK MS C++ TESTS 19 46 0 1500
75036983 vjudge3 B April 1, 2020, 4:07 a.m. OK MS C++ 2017 TESTS 19 30 0 1500
75968386 leventa B April 9, 2020, 8:28 a.m. OK MS C++ 2017 TESTS 19 31 0 1500
75533062 vjudge2 B April 5, 2020, 4:26 a.m. OK MS C++ 2017 TESTS 19 31 0 1500
75335216 Hardes1 B April 3, 2020, 11:05 a.m. OK MS C++ 2017 TESTS 19 31 0 1500
75190113 lhs8928 B April 2, 2020, 12:25 a.m. OK MS C++ 2017 TESTS 19 31 0 1500
75179247 Tangerine B April 1, 2020, 8:14 p.m. OK MS C++ 2017 TESTS 19 31 0 1500
75087983 LeeJongHun B April 1, 2020, 2 p.m. OK MS C++ 2017 TESTS 19 31 0 1500
75036986 vjudge4 B April 1, 2020, 4:07 a.m. OK MS C++ 2017 TESTS 19 31 0 1500
75034276 batyousef B April 1, 2020, 3:08 a.m. OK MS C++ 2017 TESTS 19 31 0 1500
75031113 Kicey B April 1, 2020, 1:44 a.m. OK MS C++ 2017 TESTS 19 31 0 1500
75169085 vjudge4 B April 1, 2020, 6:05 p.m. OK Node.js TESTS 19 202 4812800 1500
75050735 vjudge3 B April 1, 2020, 7:17 a.m. OK Node.js TESTS 19 218 4608000 1500
75022253 raj1307 B March 31, 2020, 9:30 p.m. OK PyPy 2 TESTS 19 187 3993600 1500
75040855 Gaurav1 B April 1, 2020, 5:17 a.m. OK PyPy 2 TESTS 19 202 2867200 1500
74991832 chaudhary_19 B March 31, 2020, 3:56 p.m. OK PyPy 2 TESTS 19 233 9420800 1500
75610462 wolffd B April 5, 2020, 10:08 p.m. OK PyPy 2 TESTS 19 280 5836800 1500
75167696 shanu_im B April 1, 2020, 5:51 p.m. OK PyPy 2 TESTS 19 358 5324800 1500
74985302 zqx1392 B March 31, 2020, 3:36 p.m. OK PyPy 3 TESTS 19 171 3072000 1500
75022286 andrewwu73 B March 31, 2020, 9:31 p.m. OK PyPy 3 TESTS 19 171 3379200 1500
75190398 PracticeAccountICL B April 2, 2020, 12:37 a.m. OK PyPy 3 TESTS 19 171 3686400 1500
75715042 Cognac B April 7, 2020, 5:56 a.m. OK PyPy 3 TESTS 19 171 4505600 1500
75688805 KirKhal B April 6, 2020, 7:03 p.m. OK PyPy 3 TESTS 19 171 4608000 1500
74984628 notbot B March 31, 2020, 3:34 p.m. OK PyPy 3 TESTS 19 171 4812800 1500
75270768 beethoven97 B April 2, 2020, 5:22 p.m. OK PyPy 3 TESTS 19 186 2867200 1500
74982873 DanTheMan314 B March 31, 2020, 3:28 p.m. OK PyPy 3 TESTS 19 186 3993600 1500
75040487 akshaysolanki941 B April 1, 2020, 5:11 a.m. OK PyPy 3 TESTS 19 186 4300800 1500
75800705 sonagi B April 8, 2020, 4:18 a.m. OK PyPy 3 TESTS 19 186 5017600 1500
75012166 ComptineDunAutreEte B March 31, 2020, 6:51 p.m. OK Python 2 TESTS 19 202 102400 1500
75006291 Vedanshu B March 31, 2020, 6:07 p.m. OK Python 3 TESTS 19 109 512000 1500
75039350 checkingagain B April 1, 2020, 4:52 a.m. OK Python 3 TESTS 19 109 614400 1500
75039447 pavanbsp B April 1, 2020, 4:53 a.m. OK Python 3 TESTS 19 124 307200 1500
75003620 XL-Wrath B March 31, 2020, 5:40 p.m. OK Python 3 TESTS 19 124 307200 1500
75001229 vladglebovv B March 31, 2020, 5:20 p.m. OK Python 3 TESTS 19 124 307200 1500
75509924 ixuan B April 4, 2020, 5:47 p.m. OK Python 3 TESTS 19 124 512000 1500
75054026 stars_in_the_sky B April 1, 2020, 7:57 a.m. OK Python 3 TESTS 19 124 512000 1500
75024963 eugalt B March 31, 2020, 10:36 p.m. OK Python 3 TESTS 19 124 512000 1500
75018214 dogatekin B March 31, 2020, 8:15 p.m. OK Python 3 TESTS 19 124 512000 1500
75016603 xingdong B March 31, 2020, 7:52 p.m. OK Python 3 TESTS 19 124 512000 1500
75928199 tbogus B April 8, 2020, 8:15 p.m. OK Ruby TESTS 19 92 5427200 1500
75929098 tbogus B April 8, 2020, 8:28 p.m. OK Ruby TESTS 19 93 409600 1500
74992173 kobae964 B March 31, 2020, 3:57 p.m. OK Rust TESTS 19 31 409600 1500
75004326 cotton100pc B March 31, 2020, 5:47 p.m. OK Rust TESTS 19 46 204800 1500
74983606 rustafarian B March 31, 2020, 3:31 p.m. OK Rust TESTS 19 46 307200 1500
75009056 IvanDyachenko B March 31, 2020, 6:22 p.m. OK Scala TESTS 19 639 1024000 1500

remove filters

Back to search problems