VK Cup 2017 - Round 3

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
773 VK Cup 2017 - Round 3 FINISHED False 10800 282320085 May 7, 2017, 3:45 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 996 ) C Prairie Partition PROGRAMMING binary search constructive algorithms greedy math 2300

It can be shown that any positive integer x can be uniquely represented as x = 1 + 2 + 4 + ... + 2 k - 1 + r , where k and r are integers, k ≥ 0 , 0 < r ≤ 2 k . Let's call that representation prairie partition of x . For example, the prairie partitions of 12 , 17 , 7 and 1 are: 17 = 1 + 2 + 4 + 8 + 2 , 7 = 1 + 2 + 4 , 1 = 1 . Alice took a sequence of positive integers (possibly with repeating elements), replaced every element with the sequence of summands in its prairie partition, arranged the resulting numbers in non-decreasing order and gave them to Borys. Now Borys wonders how many elements Alice's original sequence could contain. Find all possible options! The first line contains a single integer n ( 1 ≤ n ≤ 10 5 ) — the number of numbers given from Alice to Borys. The second line contains n integers a 1 , a 2 , ..., a n ( 1 ≤ a i ≤ 10 12 ; a 1 ≤ a 2 ≤ ... ≤ a n ) — the numbers given from Alice to Borys. Output, in increasing order , all possible values of m such that there exists a sequence of positive integers of length m such that if you replace every element with the summands in its prairie partition and arrange the resulting numbers in non-decreasing order, you will get the sequence given in the input. If there are no such values of m , output a single integer -1 . In the first example, Alice could get the input sequence from 6, 20 as the original sequence. In the second example, Alice's original sequence could be either 4, 5 or 3, 3, 3 .

Tutorials

VK Cup 2017 Round 3 + Codeforces Round #412 -- Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
27198321 xzyxzy C May 18, 2017, 2:07 p.m. OK GNU C++ TESTS 75 15 0 2300
40982297 ReaLNero1 C July 30, 2018, 6:21 p.m. OK GNU C++ TESTS 75 31 0 2300
27011360 vjudge3 C May 11, 2017, 11:48 a.m. OK GNU C++ TESTS 75 31 0 2300
27230885 vjudge5 C May 20, 2017, 8:03 a.m. OK GNU C++ TESTS 75 46 0 2300
27354442 krijgertje C May 26, 2017, 11:17 a.m. OK GNU C++ TESTS 75 46 409600 2300
27060699 chm517 C May 12, 2017, 6:51 p.m. OK GNU C++ TESTS 75 46 819200 2300
29125196 vjudge1 C Aug. 2, 2017, 9:38 a.m. OK GNU C++ TESTS 75 46 2252800 2300
27013889 vjudge1 C May 11, 2017, 1:05 p.m. OK GNU C++ TESTS 75 46 3072000 2300
26947486 slelaron C May 7, 2017, 10:16 p.m. OK GNU C++ TESTS 75 187 1638400 2300
27229448 Dirak C May 20, 2017, 6:41 a.m. OK GNU C++11 TESTS 75 30 102400 2300
27277286 Lweb C May 22, 2017, 5:12 a.m. OK GNU C++11 TESTS 75 31 0 2300
26977725 zzhzz C May 9, 2017, 3:46 p.m. OK GNU C++11 TESTS 75 31 0 2300
26937732 kb. Tinsane C May 7, 2017, 5:27 p.m. OK GNU C++11 TESTS 75 31 0 2300
29236633 vjudge1 C Aug. 6, 2017, 8:36 a.m. OK GNU C++11 TESTS 75 31 2150400 2300
26944497 Aidos C May 7, 2017, 7:03 p.m. OK GNU C++11 TESTS 75 31 4300800 2300
26940946 Sert C May 7, 2017, 6:06 p.m. OK GNU C++11 TESTS 75 31 16588800 2300
62250305 2016smy C Oct. 10, 2019, 9:04 a.m. OK GNU C++11 TESTS 75 46 0 2300
52944738 Pigbrain C April 18, 2019, 11:03 a.m. OK GNU C++11 TESTS 75 46 0 2300
43942507 emoairx C Oct. 7, 2018, 12:07 p.m. OK GNU C++11 TESTS 75 46 0 2300
27303478 iynaur87 C May 23, 2017, 2:44 p.m. OK GNU C++14 TESTS 75 31 204800 2300
26946257 Bobrosoft C May 7, 2017, 8:22 p.m. OK GNU C++14 TESTS 75 31 819200 2300
26939813 Kronecker C May 7, 2017, 5:52 p.m. OK GNU C++14 TESTS 75 31 1331200 2300
57292684 Arg_007 C July 18, 2019, 5:29 p.m. OK GNU C++14 TESTS 75 46 0 2300
27292991 InvUsr C May 23, 2017, 2:42 a.m. OK GNU C++14 TESTS 75 46 0 2300
27000180 Flyce C May 10, 2017, 4:50 p.m. OK GNU C++14 TESTS 75 46 0 2300
26973228 apiadu C May 9, 2017, 12:07 p.m. OK GNU C++14 TESTS 75 46 0 2300
26954604 after C May 8, 2017, 10:40 a.m. OK GNU C++14 TESTS 75 46 0 2300
26936804 AllCatsAreBeautiful C May 7, 2017, 5:17 p.m. OK GNU C++14 TESTS 75 46 0 2300
26934491 Vladyslav Omelianenko C May 7, 2017, 4:51 p.m. OK GNU C++14 TESTS 75 46 614400 2300
55664210 chongryong C June 17, 2019, 1:41 a.m. OK GNU C++17 TESTS 75 46 819200 2300
62924894 Phortox C Oct. 19, 2019, 11:04 a.m. OK GNU C++17 TESTS 75 46 2048000 2300
55664421 chongryong C June 17, 2019, 1:57 a.m. OK GNU C++17 TESTS 75 62 819200 2300
48952922 zhangqingqi C Jan. 26, 2019, 1:53 a.m. OK GNU C++17 TESTS 75 62 1024000 2300
67291981 vjudge5 C Dec. 20, 2019, 3:51 p.m. OK GNU C++17 TESTS 75 62 5632000 2300
54975093 hjk1030 C June 2, 2019, 10:24 a.m. OK GNU C++17 TESTS 75 62 8806400 2300
41459620 des1997 C Aug. 11, 2018, 8:03 a.m. OK GNU C++17 TESTS 75 156 2252800 2300
47369624 Laiu C Dec. 22, 2018, 1:29 p.m. OK GNU C++17 TESTS 75 156 2457600 2300
67259414 vjudge4 C Dec. 20, 2019, 2:07 a.m. OK GNU C++17 TESTS 75 1357 512000 2300
54914382 Ahmad_Elsagheer C June 1, 2019, 12:54 p.m. OK Java 8 TESTS 75 140 0 2300
26946094 kenkoooo C May 7, 2017, 8:10 p.m. OK Java 8 TESTS 75 155 0 2300
26945994 kenkoooo C May 7, 2017, 8:03 p.m. OK Java 8 TESTS 75 155 0 2300
26940684 alex700 WiBk C May 7, 2017, 6:03 p.m. OK Java 8 TESTS 75 218 0 2300
26934075 RomaWhite witua C May 7, 2017, 4:47 p.m. OK MS C++ TESTS 75 93 102400 2300
26935720 jk_qq Ancient_mage C May 7, 2017, 5:05 p.m. OK MS C++ TESTS 75 93 1638400 2300
52598912 meooow C April 11, 2019, 10:52 a.m. OK PyPy 3 TESTS 75 546 13414400 2300
42141197 Mk_Python_v1 C Aug. 27, 2018, 5:36 a.m. OK Python 3 TESTS 75 561 6860800 2300

remove filters

Back to search problems