Codeforces Round 171 (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
279 Codeforces Round 171 (Div. 2) FINISHED False 7200 369412199 March 4, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 742 ) D The Minimum Number of Variables PROGRAMMING bitmasks dp 2600

B"You've got a positive integer sequence a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an. All numbers in the sequence are distinct. Let's fix the set of variables b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bm. Initially each variable bi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m) contains the value of zero. Consider the following sequence, consisting of n operations. The first operation is assigning the value of a1 to some variable bx (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m). Each of the following n xe2 x80 x89- xe2 x80 x891 operations is assigning to some variable by the value that is equal to the sum of values that are stored in the variables bi and bj (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i, xe2 x80 x89j, xe2 x80 x89y xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m). At that, the value that is assigned on the t-th operation, must equal at. For each operation numbers y, xe2 x80 x89i, xe2 x80 x89j are chosen anew. Your task is to find the minimum number of variables m, such that those variables can help you perform the described sequence of operations. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8923). The second line contains n space-separated integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ak xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). It is guaranteed that all numbers in the sequence are distinct. In a single line print a single number -- the minimum number of variables m, such that those variables can help you perform the described sequence of operations. If you cannot perform the sequence of operations at any m, print -1. In the first sample, you can use two variables b1 and b2 to perform the following sequence of operations."...

Tutorials

Codeforces Round #171 (Div. 2) Разбор Задач

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
37464770 rainboy D April 19, 2018, 2:22 p.m. OK GNU C TESTS 70 249 15974400 2600
37464670 rainboy D April 19, 2018, 2:19 p.m. OK GNU C TESTS 70 280 15974400 2600
30563540 vjudge2 D Sept. 21, 2017, 12:04 a.m. OK GNU C++ TESTS 70 15 33587200 2600
30545904 vjudge3 D Sept. 20, 2017, 12:59 p.m. OK GNU C++ TESTS 70 15 33587200 2600
35857121 ______u______ D March 2, 2018, 8:34 p.m. OK GNU C++ TESTS 70 15 35737600 2600
35856854 ______n______ D March 2, 2018, 8:28 p.m. OK GNU C++ TESTS 70 15 35737600 2600
35856416 _____i_____ D March 2, 2018, 8:20 p.m. OK GNU C++ TESTS 70 15 35737600 2600
35856299 _____k_____ D March 2, 2018, 8:17 p.m. OK GNU C++ TESTS 70 15 35737600 2600
35847599 ______k______ D March 2, 2018, 4:45 p.m. OK GNU C++ TESTS 70 15 35737600 2600
35847595 ______h______ D March 2, 2018, 4:45 p.m. OK GNU C++ TESTS 70 15 35737600 2600
35847226 ______i______ D March 2, 2018, 4:40 p.m. OK GNU C++ TESTS 70 15 35737600 2600
35842816 ______M______ D March 2, 2018, 3 p.m. OK GNU C++ TESTS 70 15 35737600 2600
23286621 vjudge2 D Dec. 25, 2016, 7:31 a.m. OK GNU C++11 TESTS 70 15 35737600 2600
25016604 vjudge2 D Feb. 25, 2017, 3:34 p.m. OK GNU C++11 TESTS 70 15 69324800 2600
19763906 sahedsohel D Aug. 10, 2016, 10:54 a.m. OK GNU C++11 TESTS 70 30 10854400 2600
68217367 KyuushuKyuuhai D Jan. 5, 2020, 1:20 a.m. OK GNU C++11 TESTS 70 31 33587200 2600
57897153 lopare D July 28, 2019, 2:04 p.m. OK GNU C++11 TESTS 70 31 33587200 2600
57821396 py_ultron D July 26, 2019, 11:36 p.m. OK GNU C++11 TESTS 70 31 33587200 2600
30542506 vjudge5 D Sept. 20, 2017, 11:16 a.m. OK GNU C++11 TESTS 70 31 33587200 2600
42293802 ivanilos D Aug. 31, 2018, 12:34 a.m. OK GNU C++11 TESTS 70 31 134553600 2600
19867660 next_code D Aug. 14, 2016, 11:42 a.m. OK GNU C++11 TESTS 70 62 69324800 2600
23251541 vjudge3 D Dec. 23, 2016, 4:10 p.m. OK GNU C++11 TESTS 70 93 245862400 2600
27812888 JhonnyZaz D June 15, 2017, 10:18 p.m. OK GNU C++14 TESTS 70 62 134451200 2600
27783675 JhonnyZaz D June 15, 2017, 12:31 a.m. OK GNU C++14 TESTS 70 109 3379200 2600
20978606 abhinavaggarwal D Sept. 28, 2016, 8:22 p.m. OK GNU C++14 TESTS 70 171 8396800 2600
65917349 rfpermen D Nov. 28, 2019, 3:05 p.m. OK GNU C++14 TESTS 70 171 16998400 2600
20978654 abhinavaggarwal D Sept. 28, 2016, 8:25 p.m. OK GNU C++14 TESTS 70 186 8396800 2600
20978591 abhinavaggarwal D Sept. 28, 2016, 8:21 p.m. OK GNU C++14 TESTS 70 187 8396800 2600
33046098 sarkar D Dec. 9, 2017, 10:45 a.m. OK GNU C++14 TESTS 70 202 82022400 2600
65901818 rfpermen D Nov. 28, 2019, 9:05 a.m. OK GNU C++14 TESTS 70 265 17203200 2600
20978626 abhinavaggarwal D Sept. 28, 2016, 8:23 p.m. OK GNU C++14 TESTS 70 280 8396800 2600
32134207 vjudge3 D Nov. 8, 2017, 5:44 a.m. OK GNU C++14 TESTS 70 280 16998400 2600
63122506 ftiasch D Oct. 22, 2019, 11:47 a.m. OK GNU C++17 TESTS 70 31 8396800 2600
52080808 ruo D March 31, 2019, 12:06 p.m. OK GNU C++17 TESTS 70 31 16793600 2600
61862702 roll_no_1 D Oct. 4, 2019, 3:45 p.m. OK GNU C++17 TESTS 70 171 8601600 2600
61557777 hjk1030 D Sept. 30, 2019, 2:34 p.m. OK GNU C++17 TESTS 70 171 151859200 2600
55523733 kostia244 D June 13, 2019, 10:01 a.m. OK GNU C++17 TESTS 70 280 33587200 2600
42315584 loyolman D Aug. 31, 2018, 5:09 p.m. OK GNU C++17 TESTS 70 312 1331200 2600
43092376 terminator D Sept. 19, 2018, 7:41 p.m. OK GNU C++17 TESTS 70 374 2150400 2600
55009915 UnstoppableChillMachine D June 3, 2019, 9:32 a.m. OK GNU C++17 TESTS 70 390 193331200 2600
66588465 ivan100sic D Dec. 10, 2019, 12:06 p.m. OK GNU C++17 TESTS 70 592 33587200 2600
61878767 Juvitus D Oct. 4, 2019, 9:39 p.m. OK GNU C++17 TESTS 70 639 67379200 2600
49809800 Shaykhutdinov-T-I D Feb. 11, 2019, 11:06 p.m. OK Java 8 TESTS 70 811 14950400 2600
20471076 Dukkha D Sept. 9, 2016, 2:34 a.m. OK Java 8 TESTS 70 857 15052800 2600

remove filters

Back to search problems