Educational Codeforces Round 12

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
665 Educational Codeforces Round 12 FINISHED False 7200 276447604 April 20, 2016, 3 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3691 ) D Simple Subset PROGRAMMING constructive algorithms greedy number theory 2000

B"A tuple of positive integers {x1, xe2 x80 x89x2, xe2 x80 x89..., xe2 x80 x89xk} is called simple if for all pairs of positive integers (i, xe2 x80 x89 xe2 x80 x89j) (1 xe2 x80 x89 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x80 x89< xe2 x80 x89 xe2 x80 x89j xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k), xi xe2 x80 x89 xe2 x80 x89+ xe2 x80 x89 xe2 x80 x89xj is a prime. You are given an array a with n positive integers a1, xe2 x80 x89 xe2 x80 x89a2, xe2 x80 x89 xe2 x80 x89..., xe2 x80 x89 xe2 x80 x89an (not necessary distinct). You want to find a simple subset of the array a with the maximum size. A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself. Let's define a subset of the array a as a tuple that can be obtained from a by removing some (possibly all) elements of it. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000) -- the number of integers in the array a. The second line contains n integers ai (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) -- the elements of the array a. On the first line print integer m -- the maximum possible size of simple subset of a. On the second line print m integers bl -- the elements of the simple subset of the array a with the maximum size. If there is more than one solution you can print any of them. You can print the elements of the subset in any order. "...

Tutorials

Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
17420843 AHTuTTuTyX D April 21, 2016, 2:24 p.m. OK Delphi TESTS 66 62 26828800 2000
17568659 dohonghuan D April 29, 2016, 3:40 p.m. OK FPC TESTS 66 31 3788800 2000
17408979 nbvquang99 D April 20, 2016, 5:12 p.m. OK FPC TESTS 66 31 3891200 2000
31181081 KagamiharaNadeshiko D Oct. 10, 2017, 4:50 a.m. OK FPC TESTS 66 46 2150400 2000
17520019 Gray_58 D April 26, 2016, 10:22 a.m. OK FPC TESTS 66 46 4403200 2000
18102240 sen1998 D May 26, 2016, 10:26 a.m. OK FPC TESTS 66 46 33894400 2000
17413729 Husayn_Hasanov D April 21, 2016, 3:02 a.m. OK FPC TESTS 66 61 3891200 2000
17407006 0lkeh D April 20, 2016, 4:29 p.m. OK FPC TESTS 66 62 3891200 2000
18366442 yan_lazy D June 10, 2016, 11:16 p.m. OK FPC TESTS 66 62 4812800 2000
17506573 cookiedoth D April 25, 2016, 9:59 a.m. OK FPC TESTS 66 186 11776000 2000
18624878 Vasiliy_48 D June 21, 2016, 6:06 a.m. OK FPC TESTS 66 187 7987200 2000
17492456 rainboy D April 24, 2016, 5:47 p.m. OK GNU C TESTS 66 31 4096000 2000
27995306 srijansingh D June 24, 2017, 2:13 a.m. OK GNU C TESTS 66 61 9932800 2000
17407100 sgtlaugh D April 20, 2016, 4:30 p.m. OK GNU C TESTS 66 62 45465600 2000
17461405 neo11235 D April 22, 2016, 6:12 p.m. OK GNU C TESTS 66 920 2048000 2000
17418956 hlg152jianjian D April 21, 2016, 12:40 p.m. OK GNU C TESTS 66 951 2048000 2000
34192763 adityakumar3811 D Jan. 15, 2018, 9:13 a.m. OK GNU C++ TESTS 66 15 2048000 2000
19229915 Yash_ D July 19, 2016, 10:48 a.m. OK GNU C++ TESTS 66 15 2048000 2000
17976502 seeker D May 18, 2016, 8:22 a.m. OK GNU C++ TESTS 66 15 2355200 2000
17563858 Thomas0726 D April 29, 2016, 9:40 a.m. OK GNU C++ TESTS 66 15 3276800 2000
17822368 vjudge4 D May 9, 2016, 3:38 p.m. OK GNU C++ TESTS 66 15 4198400 2000
17822366 pegasas D May 9, 2016, 3:38 p.m. OK GNU C++ TESTS 66 15 4198400 2000
18383724 I_Love_EEvilCatt D June 12, 2016, 2:50 a.m. OK GNU C++ TESTS 66 15 4300800 2000
17875806 cheer1234 D May 12, 2016, 12:55 p.m. OK GNU C++ TESTS 66 15 12288000 2000
17719474 hehe0625 D May 5, 2016, 2:31 p.m. OK GNU C++ TESTS 66 30 4198400 2000
17523152 luka.mirianashvili D April 26, 2016, 2:25 p.m. OK GNU C++ TESTS 66 30 4198400 2000
18610494 abhiavrondi D June 20, 2016, 7:53 a.m. OK GNU C++11 TESTS 66 15 0 2000
18712972 TechMonster D June 25, 2016, 3:23 a.m. OK GNU C++11 TESTS 66 15 2048000 2000
18542200 gamegame D June 17, 2016, 12:03 p.m. OK GNU C++11 TESTS 66 15 2048000 2000
28640876 dhuacm2 D July 17, 2017, 1:30 p.m. OK GNU C++11 TESTS 66 15 2150400 2000
28635941 dhuacm5 D July 17, 2017, 10:04 a.m. OK GNU C++11 TESTS 66 15 2150400 2000
28631067 dhuacm3 D July 17, 2017, 7:16 a.m. OK GNU C++11 TESTS 66 15 2150400 2000
28627956 dhuacm10 D July 17, 2017, 5:38 a.m. OK GNU C++11 TESTS 66 15 2150400 2000
28627839 ManuShi D July 17, 2017, 5:34 a.m. OK GNU C++11 TESTS 66 15 2150400 2000
17988373 devkothari9495 D May 19, 2016, 9:09 a.m. OK GNU C++11 TESTS 66 15 2252800 2000
17474526 zhsh D April 23, 2016, 9:32 p.m. OK GNU C++11 TESTS 66 15 2252800 2000
31134642 st-Firdavs D Oct. 8, 2017, 6:30 a.m. OK GNU C++14 TESTS 66 15 2048000 2000
30807563 demonsbane D Sept. 28, 2017, 2:23 p.m. OK GNU C++14 TESTS 66 15 2048000 2000
27548695 srinu37 D June 3, 2017, 4:23 p.m. OK GNU C++14 TESTS 66 15 2048000 2000
28315503 demerzel D July 6, 2017, 3:44 a.m. OK GNU C++14 TESTS 66 15 4915200 2000
26454224 vjudge3 D April 17, 2017, 12:20 p.m. OK GNU C++14 TESTS 66 15 7987200 2000
33019558 vjudge3 D Dec. 8, 2017, 10:13 a.m. OK GNU C++14 TESTS 66 15 10137600 2000
35975278 Ferume D March 5, 2018, 7:14 p.m. OK GNU C++14 TESTS 66 15 12492800 2000
34941494 Ziben D Feb. 5, 2018, 10:59 a.m. OK GNU C++14 TESTS 66 30 1945600 2000
31260679 Medeowex D Oct. 12, 2017, 9:08 p.m. OK GNU C++14 TESTS 66 30 2457600 2000
32482482 mohammedehab2002 D Nov. 19, 2017, 7:34 p.m. OK GNU C++14 TESTS 66 30 3891200 2000
51462810 Sisisi123123 D March 18, 2019, 9:08 p.m. OK GNU C++17 TESTS 66 15 204800 2000
68625492 Shushpanchick D Jan. 11, 2020, 9:29 p.m. OK GNU C++17 TESTS 66 31 307200 2000
54731392 DougNobrega D May 28, 2019, 12:33 a.m. OK GNU C++17 TESTS 66 31 307200 2000
39772938 ValeriiaHryhoriants D June 29, 2018, 3:58 p.m. OK GNU C++17 TESTS 66 31 307200 2000
48056288 not_egneeS D Jan. 7, 2019, 12:28 p.m. OK GNU C++17 TESTS 66 31 716800 2000
57294016 andrew D July 18, 2019, 6:11 p.m. OK GNU C++17 TESTS 66 31 2048000 2000
52537044 Darshan_J_Patel D April 9, 2019, 4:07 p.m. OK GNU C++17 TESTS 66 31 2048000 2000
50322851 Artur_W D Feb. 22, 2019, 3:16 p.m. OK GNU C++17 TESTS 66 31 2048000 2000
40415041 oToToT D July 16, 2018, 2:29 p.m. OK GNU C++17 TESTS 66 31 2048000 2000
55407780 AK. D June 10, 2019, 5:36 p.m. OK GNU C++17 TESTS 66 31 2150400 2000
17407913 Martynas D April 20, 2016, 4:47 p.m. OK Go TESTS 66 61 7884800 2000
17687069 mengsungwu D May 2, 2016, 9:23 a.m. OK Go TESTS 66 405 6246400 2000
17599568 mIchanic D April 30, 2016, 7:03 p.m. OK Java 7 TESTS 66 109 39116800 2000
17405321 Azat_Yusupov D April 20, 2016, 4:01 p.m. OK Java 7 TESTS 66 124 39526400 2000
18351099 mkirsche D June 10, 2016, 2:40 a.m. OK Java 7 TESTS 66 139 39321600 2000
17406782 nicolas.pe.92 D April 20, 2016, 4:25 p.m. OK Java 7 TESTS 66 140 39219200 2000
18443365 MedoN11 D June 14, 2016, 5:07 a.m. OK Java 7 TESTS 66 140 39321600 2000
17410095 MedoN11 D April 20, 2016, 6:25 p.m. OK Java 7 TESTS 66 140 39321600 2000
17499238 santjuan D April 24, 2016, 9:32 p.m. OK Java 7 TESTS 66 155 39116800 2000
17411288 ahmad_mamdouh D April 20, 2016, 8:27 p.m. OK Java 7 TESTS 66 202 46080000 2000
17429439 alibaba D April 22, 2016, 3:48 a.m. OK Java 7 TESTS 66 389 49561600 2000
17498849 maria12881 D April 24, 2016, 8:19 p.m. OK Java 7 TESTS 66 561 44953600 2000
17602950 techcrystal D May 1, 2016, 5:12 a.m. OK Java 8 TESTS 66 124 20582400 2000
17422860 evil_beaver D April 21, 2016, 5:16 p.m. OK Java 8 TESTS 66 139 20480000 2000
17714956 kuarc D May 5, 2016, 6:29 a.m. OK Java 8 TESTS 66 139 20582400 2000
17459533 Dukkha D April 22, 2016, 3:42 p.m. OK Java 8 TESTS 66 139 20582400 2000
17403417 dhrumil140396 D April 20, 2016, 3:35 p.m. OK Java 8 TESTS 66 139 20582400 2000
17406630 shavkat D April 20, 2016, 4:22 p.m. OK Java 8 TESTS 66 139 20684800 2000
46657639 flyman3046 D Dec. 5, 2018, 5:14 p.m. OK Java 8 TESTS 66 140 0 2000
40554189 AQT D July 19, 2018, 4:39 p.m. OK Java 8 TESTS 66 140 0 2000
17405786 Ahmad_Elsagheer D April 20, 2016, 4:07 p.m. OK Java 8 TESTS 66 140 20377600 2000
17601809 Sir-Shurikat D May 1, 2016, 1:24 a.m. OK Java 8 TESTS 66 140 20582400 2000
17562315 Arcey D April 29, 2016, 7:21 a.m. OK MS C# TESTS 66 62 11161600 2000
17403987 azukun D April 20, 2016, 3:42 p.m. OK MS C# TESTS 66 92 16384000 2000
22304763 Mem D Nov. 18, 2016, 11:08 a.m. OK MS C# TESTS 66 93 12595200 2000
17833983 sundown D May 10, 2016, 3:40 p.m. OK MS C# TESTS 66 93 13516800 2000
17682171 DigitalArtistKz D May 1, 2016, 9:03 p.m. OK MS C# TESTS 66 93 17715200 2000
17469153 dzeranov1995 D April 23, 2016, 11:46 a.m. OK MS C# TESTS 66 108 11059200 2000
17534470 tourist_hui_blya D April 27, 2016, 11:42 a.m. OK MS C# TESTS 66 124 11161600 2000
17423100 Carups D April 21, 2016, 5:39 p.m. OK MS C++ TESTS 66 15 4198400 2000
17408402 xlwinner11 D April 20, 2016, 4:57 p.m. OK MS C++ TESTS 66 30 4300800 2000
21786328 Isaac_wjl D Oct. 26, 2016, 3:54 a.m. OK MS C++ TESTS 66 31 2048000 2000
18389182 AM5800 D June 12, 2016, 11:14 a.m. OK MS C++ TESTS 66 31 2457600 2000
17927003 justindcheng D May 16, 2016, 5:18 a.m. OK MS C++ TESTS 66 31 2457600 2000
24671715 wp32pw D Feb. 14, 2017, 1:48 p.m. OK MS C++ TESTS 66 31 4198400 2000
17762018 nevergiveup D May 6, 2016, 1:24 p.m. OK MS C++ TESTS 66 31 4198400 2000
17756474 vjudge1 D May 6, 2016, 7:25 a.m. OK MS C++ TESTS 66 31 4198400 2000
17754488 vjudge5 D May 6, 2016, 5:27 a.m. OK MS C++ TESTS 66 31 4198400 2000
17715007 sister_what_hate_most D May 5, 2016, 6:37 a.m. OK MS C++ TESTS 66 31 4198400 2000
49496440 PavelChadnov D Feb. 5, 2019, 1:06 p.m. OK MS C++ 2017 TESTS 66 811 0 2000
17473849 T1024 D April 23, 2016, 8:01 p.m. OK PyPy 2 TESTS 66 171 31846400 2000
17544307 pr4j D April 27, 2016, 5:14 p.m. OK PyPy 2 TESTS 66 171 32051200 2000
17565049 fcbruce D April 29, 2016, 11:16 a.m. OK PyPy 2 TESTS 66 233 32358400 2000
22620220 CyberZHG D Nov. 30, 2016, 11:20 a.m. OK PyPy 2 TESTS 66 295 25702400 2000
17415087 abc_1988_1106 D April 21, 2016, 6:19 a.m. OK PyPy 2 TESTS 66 296 47923200 2000
17463965 pho D April 23, 2016, 12:58 a.m. OK PyPy 2 TESTS 66 358 48640000 2000
17472783 cugel D April 23, 2016, 5:45 p.m. OK PyPy 3 TESTS 66 373 31641600 2000
17478722 Fear_Is_An_Illusion D April 24, 2016, 10:45 a.m. OK PyPy 3 TESTS 66 405 54067200 2000
17428853 maxnk D April 22, 2016, 1:39 a.m. OK PyPy 3 TESTS 66 529 45363200 2000
17816367 artyom.fedosov D May 9, 2016, 6:46 a.m. OK Python 2 TESTS 66 155 15155200 2000
17506063 andreamaf D April 25, 2016, 9:23 a.m. OK Python 2 TESTS 66 733 12800000 2000
18494581 justforlaugh D June 15, 2016, 10:40 a.m. OK Python 2 TESTS 66 779 12800000 2000
48402776 introibo D Jan. 14, 2019, 11:34 p.m. OK Python 2 TESTS 66 858 18329600 2000
48402727 introibo D Jan. 14, 2019, 11:27 p.m. OK Python 2 TESTS 66 889 19148800 2000
17510360 jl9394 D April 25, 2016, 2:18 p.m. OK Python 2 TESTS 66 889 29184000 2000
34114723 yugle7 D Jan. 12, 2018, 8:56 p.m. OK Python 3 TESTS 66 234 21606400 2000
35889593 ______M______ D March 3, 2018, 2:42 p.m. OK Python 3 TESTS 66 249 21606400 2000
17425399 orailly D April 21, 2016, 9:53 p.m. OK Python 3 TESTS 66 342 13209600 2000
17425284 orailly D April 21, 2016, 9:34 p.m. OK Python 3 TESTS 66 389 13209600 2000
17554022 noelnadal D April 28, 2016, 2:39 p.m. OK Python 3 TESTS 66 794 23142400 2000
45400356 QuantumKnight D Nov. 7, 2018, 8:04 a.m. OK Python 3 TESTS 66 888 27955200 2000
17526340 dsprufus D April 26, 2016, 6:48 p.m. OK Ruby TESTS 66 608 26112000 2000

remove filters

Back to search problems