Codeforces Round 365 (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
703 Codeforces Round 365 (Div. 2) FINISHED False 8100 261499499 Aug. 4, 2016, 3:15 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 599 ) E Mishka and Divisors PROGRAMMING dp number theory 2900

B'After playing with her beautiful array, Mishka decided to learn some math. After learning how to multiply, divide and what is divisibility, she is now interested in solving the following problem. You are given integer k and array a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an of n integers. You are to find non-empty subsequence of array elements such that the product of its elements is divisible by k and it contains minimum possible number of elements. Formally, you are to find a sequence of indices 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i1 xe2 x80 x89< xe2 x80 x89i2 xe2 x80 x89< xe2 x80 x89... xe2 x80 x89< xe2 x80 x89im xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n such that is divisible by k while m is minimum possible among all such variants. If there are more than one such subsequences, you should choose one among them, such that sum of its elements is minimum possible. Mishka quickly solved this problem. Will you do so? The first line of the input contains two integers n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891 xe2 x80 x89000, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891012). The second line of the input contains n integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891012) -- array elements. Print single positive integer m in the first line -- the number of elements in desired sequence. In the second line print m distinct integers -- the sequence of indices of given array elements, which should be taken into the desired sequence. If there are more than one such subsequence (e.g. subsequence of minimum possible number of elements and with minimum possible sum of elements), you can print any of them. If there are no such subsequences, print xe2 x80 x89- xe2 x80 x891 in the only line. '...

Tutorials

Codeforces Round #365 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
20310452 Sanja E Aug. 31, 2016, 7:21 p.m. OK FPC TESTS 93 810 131788800 2900
20428582 tjytlxwxhyzqfw E Sept. 7, 2016, 4:14 a.m. OK GNU C TESTS 93 982 183398400 2900
20428315 tjytlxwxhyzqfw E Sept. 7, 2016, 3:37 a.m. OK GNU C TESTS 93 998 183500800 2900
21795181 Minology E Oct. 26, 2016, 1:29 p.m. OK GNU C++ TESTS 93 109 97382400 2900
40983919 ReaLNero1 E July 30, 2018, 7:06 p.m. OK GNU C++ TESTS 93 124 97382400 2900
19672482 Vlad_kv E Aug. 6, 2016, 3:18 p.m. OK GNU C++ TESTS 93 140 114380800 2900
19750832 guille E Aug. 9, 2016, 4:30 p.m. OK GNU C++ TESTS 93 186 199270400 2900
19639672 abeker E Aug. 4, 2016, 9:28 p.m. OK GNU C++ TESTS 93 202 204390400 2900
19639624 abeker E Aug. 4, 2016, 9:24 p.m. OK GNU C++ TESTS 93 233 204390400 2900
19666491 sjj118 E Aug. 6, 2016, 9:01 a.m. OK GNU C++ TESTS 93 311 53043200 2900
19716221 mhss E Aug. 7, 2016, 10:52 p.m. OK GNU C++ TESTS 93 389 268390400 2900
21944195 vjudge4 E Oct. 31, 2016, 4:25 p.m. OK GNU C++ TESTS 93 405 27340800 2900
20043906 Tiny E Aug. 22, 2016, 10:41 a.m. OK GNU C++ TESTS 93 420 199577600 2900
19657555 alexander86 E Aug. 5, 2016, 7:16 p.m. OK GNU C++11 TESTS 93 109 61235200 2900
19647467 halyavin E Aug. 5, 2016, 8:26 a.m. OK GNU C++11 TESTS 93 156 3072000 2900
19831364 krijgertje E Aug. 12, 2016, 3 p.m. OK GNU C++11 TESTS 93 171 110284800 2900
19667827 oml1111 E Aug. 6, 2016, 10:16 a.m. OK GNU C++11 TESTS 93 171 164966400 2900
19643241 I_love_tigersugar E Aug. 5, 2016, 4:14 a.m. OK GNU C++11 TESTS 93 186 137420800 2900
19638155 bidzilya E Aug. 4, 2016, 7:36 p.m. OK GNU C++11 TESTS 93 186 138137600 2900
19917986 jimola E Aug. 17, 2016, 1:55 a.m. OK GNU C++11 TESTS 93 187 35532800 2900
19978725 YusufHussein E Aug. 20, 2016, 9:13 a.m. OK GNU C++11 TESTS 93 280 222720000 2900
21110999 eddy1021 E Oct. 2, 2016, 9:49 a.m. OK GNU C++11 TESTS 93 312 30515200 2900
21110685 eddy1021 E Oct. 2, 2016, 9:33 a.m. OK GNU C++11 TESTS 93 358 28057600 2900
36427600 kczno1 E March 20, 2018, 8:17 a.m. OK GNU C++14 TESTS 93 124 85504000 2900
28241347 NiroBC E July 3, 2017, 2:24 a.m. OK GNU C++14 TESTS 93 124 136806400 2900
20410568 lavin E Sept. 6, 2016, 2:07 a.m. OK GNU C++14 TESTS 93 327 42598400 2900
31559271 lessmeaning E Oct. 21, 2017, 8:53 a.m. OK GNU C++14 TESTS 93 389 124211200 2900
60722127 dyxg E Sept. 17, 2019, 12:43 p.m. OK GNU C++14 TESTS 93 390 202137600 2900
27180105 993963526 E May 17, 2017, 1:10 p.m. OK GNU C++14 TESTS 93 420 164044800 2900
26477092 Thelias E April 18, 2017, 1:40 p.m. OK GNU C++14 TESTS 93 420 165888000 2900
26476778 Thelias E April 18, 2017, 1:24 p.m. OK GNU C++14 TESTS 93 420 165888000 2900
26135945 victoragnez E April 5, 2017, 5:29 a.m. OK GNU C++14 TESTS 93 420 165990400 2900
55387742 vjudge3 E June 10, 2019, 8:17 a.m. OK GNU C++14 TESTS 93 436 164044800 2900
69663252 hjk1030 E Jan. 28, 2020, 10:18 a.m. OK GNU C++17 TESTS 93 420 130252800 2900
55506597 vjudge2 E June 12, 2019, 6:16 p.m. OK GNU C++17 TESTS 93 482 164556800 2900
68405686 Mohammad.H915 E Jan. 8, 2020, 2:48 p.m. OK GNU C++17 TESTS 93 483 210432000 2900
54785909 AliShahali1382 E May 29, 2019, 3:52 a.m. OK GNU C++17 TESTS 93 545 109158400 2900
54785827 AliShahali1382 E May 29, 2019, 3:48 a.m. OK GNU C++17 TESTS 93 561 109158400 2900
54785782 AliShahali1382 E May 29, 2019, 3:45 a.m. OK GNU C++17 TESTS 93 561 109158400 2900
55981221 vjudge5 E June 23, 2019, 9:16 p.m. OK GNU C++17 TESTS 93 592 101171200 2900
69917788 user060804 E Jan. 31, 2020, 5:25 p.m. OK GNU C++17 TESTS 93 623 162816000 2900
56046282 vjudge1 E June 25, 2019, 4:45 p.m. OK GNU C++17 TESTS 93 623 250572800 2900
67657731 Anachor E Dec. 26, 2019, 2:32 p.m. OK GNU C++17 TESTS 93 624 220160000 2900
19965777 orb E Aug. 19, 2016, 2:28 p.m. OK Go TESTS 93 842 123494400 2900
30014033 mualanhlung017 E Sept. 2, 2017, 1:45 p.m. OK Java 8 TESTS 93 343 0 2900
64879608 SYury E Nov. 14, 2019, 11:11 a.m. OK Java 8 TESTS 93 343 140595200 2900
19759865 JialinOuyang E Aug. 10, 2016, 6:40 a.m. OK Java 8 TESTS 93 420 277606400 2900
19666435 hama-du E Aug. 6, 2016, 8:59 a.m. OK Java 8 TESTS 93 592 144486400 2900
20281135 nagabhushan E Aug. 30, 2016, 1:38 p.m. OK Java 8 TESTS 93 670 4300800 2900
19674627 FFyuan E Aug. 6, 2016, 5:48 p.m. OK Java 8 TESTS 93 732 165683200 2900
19643583 minhu E Aug. 5, 2016, 4:43 a.m. OK Java 8 TESTS 93 763 171724800 2900
45512848 Slamur E Nov. 10, 2018, 2:01 p.m. OK Java 8 TESTS 93 951 259686400 2900
19774102 azukun E Aug. 10, 2016, 11:44 p.m. OK MS C# TESTS 93 421 41369600 2900
19685301 AnatolyTolstobrov E Aug. 7, 2016, 10:59 a.m. OK MS C# TESTS 93 608 40652800 2900
19650063 Taube E Aug. 5, 2016, 10:54 a.m. OK MS C++ TESTS 93 794 254771200 2900

remove filters

Back to search problems