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.
Problems
B"The Hexadecimal virus loves playing with number sets -- intersecting them, uniting them. One beautiful day she was surprised to find out that Scuzzy, her spherical pet cat, united all sets in one and ate the result! Something had to be done quickly and Hexadecimal rushed to the market. The market has n sets of numbers on sale. The virus wants to buy the following collection of sets: the number of sets in the collection should be exactly the same as the number of numbers in the union of all bought sets. Moreover, Hexadecimal wants to buy the cheapest suitable collection of set. Yet nothing's so easy! As Mainframe is a kingdom of pure rivalry markets, we know that the union of any k sets contains no less than k distinct numbers (for every positive integer k). Help the virus choose the suitable collection of sets. The collection can be empty. The first line contains the only number n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89300) -- the number of sets available in the market. Next n lines describe the goods: first we are given mi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89mi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- the number of distinct numbers in the i-th set, then follow mi numbers -- the set's elements. We know that the set's elements are distinct positive integers and they do not exceed n. The last line contains n integers whose absolute values do not exceed 106 -- the price of each set. Print a single number -- the minimum price the virus will have to pay for such a collection of k sets that union of the collection's sets would have exactly k distinct numbers ()."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
1383077 |
zanoes |
E |
March 21, 2012, 3:04 a.m. |
OK |
FPC |
TESTS |
41 |
30 |
3072000 |
|
2700 |
600572 |
xynx |
E |
Aug. 9, 2011, 2:23 p.m. |
OK |
FPC |
TESTS |
41 |
30 |
3993600 |
|
2700 |
1370866 |
vjudge5 |
E |
March 16, 2012, 11:37 p.m. |
OK |
FPC |
TESTS |
41 |
30 |
4812800 |
|
2700 |
1361159 |
alsk11 |
E |
March 16, 2012, 12:48 p.m. |
OK |
FPC |
TESTS |
41 |
30 |
4812800 |
|
2700 |
890262 |
coolinging |
E |
Nov. 25, 2011, 1:10 a.m. |
OK |
FPC |
TESTS |
41 |
30 |
5017600 |
|
2700 |
626712 |
cherudim |
E |
Aug. 23, 2011, 3:32 a.m. |
OK |
FPC |
TESTS |
41 |
30 |
8601600 |
|
2700 |
2587290 |
luogan |
E |
Nov. 19, 2012, 6:53 a.m. |
OK |
FPC |
TESTS |
41 |
31 |
2764800 |
|
2700 |
10993301 |
ez_cjb |
E |
May 4, 2015, 7:21 a.m. |
OK |
FPC |
TESTS |
41 |
62 |
5529600 |
|
2700 |
15141558 |
HappyNewYearMike |
E |
Dec. 31, 2015, 9:36 p.m. |
OK |
GNU C |
TESTS |
41 |
30 |
3276800 |
|
2700 |
668916 |
scottai1 |
E |
Sept. 5, 2011, 9:32 a.m. |
OK |
GNU C |
TESTS |
41 |
30 |
4608000 |
|
2700 |
596159 |
YuukaKazami |
E |
Aug. 7, 2011, 2:41 p.m. |
OK |
GNU C++ |
TESTS |
41 |
10 |
1536000 |
|
2700 |
3969006 |
sexyprincess91 |
E |
June 27, 2013, 9:36 p.m. |
OK |
GNU C++ |
TESTS |
41 |
15 |
204800 |
|
2700 |
2880134 |
sillycross |
E |
Jan. 7, 2013, 9:08 a.m. |
OK |
GNU C++ |
TESTS |
41 |
15 |
204800 |
|
2700 |
2882011 |
graysky |
E |
Jan. 8, 2013, 5:28 a.m. |
OK |
GNU C++ |
TESTS |
41 |
15 |
409600 |
|
2700 |
2922608 |
moondance |
E |
Jan. 14, 2013, 12:45 a.m. |
OK |
GNU C++ |
TESTS |
41 |
15 |
1536000 |
|
2700 |
2906751 |
kmxyvb |
E |
Jan. 12, 2013, 5:46 a.m. |
OK |
GNU C++ |
TESTS |
41 |
15 |
1536000 |
|
2700 |
2882188 |
Leo_Yu |
E |
Jan. 8, 2013, 7:19 a.m. |
OK |
GNU C++ |
TESTS |
41 |
15 |
1536000 |
|
2700 |
2794870 |
Mahdi |
E |
Dec. 19, 2012, 1:50 p.m. |
OK |
GNU C++ |
TESTS |
41 |
15 |
1638400 |
|
2700 |
2769824 |
sayade |
E |
Dec. 15, 2012, 10:45 a.m. |
OK |
GNU C++ |
TESTS |
41 |
15 |
2150400 |
|
2700 |
2881993 |
dhh1995 |
E |
Jan. 8, 2013, 5:13 a.m. |
OK |
GNU C++ |
TESTS |
41 |
15 |
2355200 |
|
2700 |
2817927 |
bakabakashyoshyo |
E |
Dec. 23, 2012, 6:13 a.m. |
OK |
GNU C++0x |
TESTS |
41 |
15 |
2560000 |
|
2700 |
2880511 |
xlk |
E |
Jan. 7, 2013, 12:57 p.m. |
OK |
GNU C++0x |
TESTS |
41 |
15 |
3174400 |
|
2700 |
598135 |
DDDDDDDDDDDDDDDDDDDDDDDD |
E |
Aug. 8, 2011, 8:41 a.m. |
OK |
GNU C++0x |
TESTS |
41 |
30 |
10035200 |
|
2700 |
2640966 |
llj_bash |
E |
Nov. 25, 2012, 11:11 a.m. |
OK |
GNU C++0x |
TESTS |
41 |
31 |
512000 |
|
2700 |
2561733 |
roosephu |
E |
Nov. 15, 2012, 6:48 a.m. |
OK |
GNU C++0x |
TESTS |
41 |
31 |
4812800 |
|
2700 |
2751398 |
dc. |
E |
Dec. 11, 2012, 1:56 p.m. |
OK |
GNU C++0x |
TESTS |
41 |
31 |
12902400 |
|
2700 |
2631104 |
apia |
E |
Nov. 23, 2012, 10:01 a.m. |
OK |
GNU C++0x |
TESTS |
41 |
46 |
12083200 |
|
2700 |
10188368 |
SWATMaD |
E |
March 7, 2015, 9:49 a.m. |
OK |
GNU C++0x |
TESTS |
41 |
62 |
204800 |
|
2700 |
29779038 |
theodor.moroianu |
E |
Aug. 25, 2017, 12:30 p.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
102400 |
|
2700 |
22217581 |
Ragdoll |
E |
Nov. 15, 2016, 6:38 a.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
102400 |
|
2700 |
19264049 |
LHiC |
E |
July 19, 2016, 11:11 p.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
102400 |
|
2700 |
14544364 |
skrydg |
E |
Nov. 28, 2015, 4:56 p.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
102400 |
|
2700 |
18875106 |
RNS_CUS |
E |
July 4, 2016, 2:07 a.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
204800 |
|
2700 |
18575324 |
zhangzj |
E |
June 18, 2016, 9:01 a.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
819200 |
|
2700 |
13226820 |
wyxourlove |
E |
Sept. 26, 2015, 2:04 a.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
1433600 |
|
2700 |
23486852 |
letsbe |
E |
Jan. 1, 2017, 4:44 p.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
2150400 |
|
2700 |
18779778 |
lgkm39 |
E |
June 29, 2016, 8:30 a.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
2252800 |
|
2700 |
20923786 |
KyleYoung |
E |
Sept. 26, 2016, 11:20 a.m. |
OK |
GNU C++11 |
TESTS |
41 |
30 |
2457600 |
|
2700 |
30824106 |
RUSH_D_CAT |
E |
Sept. 29, 2017, 8:56 a.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
307200 |
|
2700 |
22514507 |
irkstepanov |
E |
Nov. 26, 2016, 5:48 p.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
409600 |
|
2700 |
22649145 |
PMichalak |
E |
Dec. 1, 2016, 10:02 p.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
1638400 |
|
2700 |
34521031 |
Artistic_Fantasy |
E |
Jan. 24, 2018, 3:13 p.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
2150400 |
|
2700 |
33283830 |
petil777 |
E |
Dec. 16, 2017, 8:20 a.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
2150400 |
|
2700 |
33280189 |
petil777 |
E |
Dec. 16, 2017, 3:47 a.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
2150400 |
|
2700 |
33280021 |
petil777 |
E |
Dec. 16, 2017, 3:24 a.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
2150400 |
|
2700 |
28712646 |
letsbe |
E |
July 20, 2017, 5:39 a.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
2150400 |
|
2700 |
23671253 |
Ali.Pi |
E |
Jan. 9, 2017, 9:22 p.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
2150400 |
|
2700 |
29318785 |
innounce |
E |
Aug. 10, 2017, 6:09 a.m. |
OK |
GNU C++14 |
TESTS |
41 |
30 |
2252800 |
|
2700 |
38708758 |
__debug |
E |
May 29, 2018, 4:07 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
30 |
32256000 |
|
2700 |
47498474 |
kefaa2 |
E |
Dec. 25, 2018, 4:21 p.m. |
OK |
GNU C++17 |
TESTS |
41 |
60 |
204800 |
|
2700 |
48322220 |
Shayan.P |
E |
Jan. 13, 2019, 9:58 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
60 |
512000 |
|
2700 |
48049708 |
golden_deathadder |
E |
Jan. 7, 2019, 7:55 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
60 |
512000 |
|
2700 |
48049677 |
golden_deathadder |
E |
Jan. 7, 2019, 7:54 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
60 |
512000 |
|
2700 |
59884144 |
hbi1998 |
E |
Sept. 2, 2019, 6:56 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
60 |
1638400 |
|
2700 |
47498450 |
kefaa2 |
E |
Dec. 25, 2018, 4:20 p.m. |
OK |
GNU C++17 |
TESTS |
41 |
62 |
204800 |
|
2700 |
57824477 |
Trote_w |
E |
July 27, 2019, 2:07 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
62 |
512000 |
|
2700 |
48049747 |
golden_deathadder |
E |
Jan. 7, 2019, 7:57 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
62 |
512000 |
|
2700 |
48049735 |
golden_deathadder |
E |
Jan. 7, 2019, 7:56 a.m. |
OK |
GNU C++17 |
TESTS |
41 |
62 |
512000 |
|
2700 |
8716393 |
AlexFetisov |
E |
Nov. 17, 2014, 7:57 a.m. |
OK |
Java 8 |
TESTS |
41 |
312 |
0 |
|
2700 |
3735639 |
BIT_silence |
E |
May 19, 2013, 6:41 a.m. |
OK |
MS C++ |
TESTS |
41 |
15 |
2048000 |
|
2700 |
601193 |
maksay |
E |
Aug. 9, 2011, 10:46 p.m. |
OK |
MS C++ |
TESTS |
41 |
30 |
2252800 |
|
2700 |
598165 |
UESTC_Nocturne |
E |
Aug. 8, 2011, 8:56 a.m. |
OK |
MS C++ |
TESTS |
41 |
30 |
3072000 |
|
2700 |
688676 |
Orpheus2012 |
E |
Sept. 10, 2011, 4:22 p.m. |
OK |
MS C++ |
TESTS |
41 |
30 |
4812800 |
|
2700 |
594225 |
SergeyRogulenko |
E |
Aug. 7, 2011, 12:29 p.m. |
OK |
MS C++ |
TESTS |
41 |
30 |
4915200 |
|
2700 |
640661 |
Borisp |
E |
Aug. 28, 2011, 10:09 a.m. |
OK |
MS C++ |
TESTS |
41 |
50 |
9830400 |
|
2700 |
12163928 |
NUOUN |
E |
July 22, 2015, 1:04 p.m. |
OK |
MS C++ |
TESTS |
41 |
62 |
11366400 |
|
2700 |
remove filters
Back to search problems