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'A nearby pie shop is having a special sale. For each pie you pay full price for, you may select one pie of a strictly lesser value to get for free. Given the prices of all the pies you wish to acquire, determine the minimum total amount you must pay for all of the pies. Input will begin with an integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89500000), the number of pies you wish to acquire. Following this is a line with n integers, each indicating the cost of a pie. All costs are positive integers not exceeding 109. Print the minimum cost to acquire all the pies. Please, do not use the %lld specifier to read or write 64-bit integers in xd0 xa1++. It is preferred to use the cin, cout streams or the %I64d specifier. In the first test case you can pay for a pie with cost 5 and get a pie with cost 4 for free, then pay for a pie with cost 5 and get a pie with cost 3 for free, then pay for a pie with cost 4 and get a pie with cost 3 for free. In the second test case you have to pay full price for every pie.'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
4304773 |
tzzcl |
F |
Aug. 17, 2013, 5:26 p.m. |
OK |
GNU C++ |
TESTS |
46 |
124 |
22016000 |
|
2900 |
14657722 |
unknown_shadow |
F |
Dec. 5, 2015, 6:18 a.m. |
OK |
GNU C++ |
TESTS |
46 |
218 |
5836800 |
|
2900 |
23168814 |
ShinFeb |
F |
Dec. 20, 2016, 3:51 a.m. |
OK |
GNU C++ |
TESTS |
46 |
218 |
7680000 |
|
2900 |
26055677 |
XuYipei |
F |
April 1, 2017, 2 p.m. |
OK |
GNU C++ |
TESTS |
46 |
218 |
16076800 |
|
2900 |
11595701 |
vetiro |
F |
June 15, 2015, 2:55 p.m. |
OK |
GNU C++ |
TESTS |
46 |
218 |
19763200 |
|
2900 |
39599954 |
sshockwave |
F |
June 24, 2018, 11:13 a.m. |
OK |
GNU C++ |
TESTS |
46 |
248 |
12083200 |
|
2900 |
40989627 |
ReaLNero1 |
F |
July 30, 2018, 11:07 p.m. |
OK |
GNU C++ |
TESTS |
46 |
248 |
19251200 |
|
2900 |
4243339 |
krijgertje |
F |
Aug. 8, 2013, 11:58 a.m. |
OK |
GNU C++ |
TESTS |
46 |
248 |
22016000 |
|
2900 |
13889074 |
HJWJBSR |
F |
Oct. 27, 2015, 11:11 a.m. |
OK |
GNU C++ |
TESTS |
46 |
312 |
11264000 |
|
2900 |
7407691 |
Ra16bit |
F |
Aug. 9, 2014, 5:03 p.m. |
OK |
GNU C++ |
TESTS |
46 |
342 |
6144000 |
|
2900 |
9922847 |
zshi |
F |
Feb. 19, 2015, 7:13 a.m. |
OK |
GNU C++0x |
TESTS |
46 |
404 |
15155200 |
|
2900 |
9548601 |
zhj |
F |
Jan. 25, 2015, 12:08 p.m. |
OK |
GNU C++0x |
TESTS |
46 |
468 |
8294400 |
|
2900 |
5838122 |
seasons-in-the-sun |
F |
Jan. 30, 2014, 11:43 a.m. |
OK |
GNU C++0x |
TESTS |
46 |
1092 |
29081600 |
|
2900 |
45277956 |
Panole233 |
F |
Nov. 4, 2018, 12:09 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
186 |
5836800 |
|
2900 |
64729333 |
yugao |
F |
Nov. 12, 2019, 7:46 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
186 |
8089600 |
|
2900 |
55966606 |
dyxg |
F |
June 23, 2019, 12:28 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
186 |
9830400 |
|
2900 |
48423700 |
Anson529 |
F |
Jan. 15, 2019, 1:54 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
216 |
5632000 |
|
2900 |
57574949 |
zjcxlh |
F |
July 23, 2019, 6:40 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
218 |
11468800 |
|
2900 |
48370453 |
ww3113306 |
F |
Jan. 14, 2019, 3:48 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
248 |
11571200 |
|
2900 |
64689097 |
zhaotiensn |
F |
Nov. 11, 2019, 12:36 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
248 |
20787200 |
|
2900 |
63282186 |
LuciferX07 |
F |
Oct. 24, 2019, 9:04 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
280 |
13107200 |
|
2900 |
64676703 |
wqst |
F |
Nov. 11, 2019, 8:20 a.m. |
OK |
GNU C++11 |
TESTS |
46 |
280 |
19148800 |
|
2900 |
62866379 |
luogu_bot3 |
F |
Oct. 18, 2019, 12:21 p.m. |
OK |
GNU C++11 |
TESTS |
46 |
312 |
7987200 |
|
2900 |
59892837 |
consecutivelimit |
F |
Sept. 2, 2019, 11:03 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
404 |
5632000 |
|
2900 |
59924399 |
lzoiexplorer2004 |
F |
Sept. 3, 2019, 2:37 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
528 |
19251200 |
|
2900 |
23548298 |
wangyenjen |
F |
Jan. 5, 2017, 5:54 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
530 |
11059200 |
|
2900 |
40362744 |
kingsnow |
F |
July 15, 2018, 3:01 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
560 |
16384000 |
|
2900 |
23538707 |
hungchuhui |
F |
Jan. 4, 2017, 3:46 p.m. |
OK |
GNU C++14 |
TESTS |
46 |
624 |
26624000 |
|
2900 |
24108330 |
jasonvictoryan |
F |
Jan. 25, 2017, 9:30 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
654 |
12185600 |
|
2900 |
62643017 |
Noam527 |
F |
Oct. 15, 2019, 6:41 p.m. |
OK |
GNU C++14 |
TESTS |
46 |
654 |
19148800 |
|
2900 |
62642940 |
Noam527 |
F |
Oct. 15, 2019, 6:40 p.m. |
OK |
GNU C++14 |
TESTS |
46 |
654 |
91443200 |
|
2900 |
36261914 |
rastogi.fresh88 |
F |
March 13, 2018, 10:28 p.m. |
OK |
GNU C++14 |
TESTS |
46 |
1028 |
28160000 |
|
2900 |
35748453 |
boook |
F |
Feb. 27, 2018, 12:47 a.m. |
OK |
GNU C++14 |
TESTS |
46 |
1090 |
26009600 |
|
2900 |
57481445 |
pocket_lengend |
F |
July 22, 2019, 2:36 a.m. |
OK |
GNU C++17 |
TESTS |
46 |
436 |
7577600 |
|
2900 |
64671759 |
Zhou_JK |
F |
Nov. 11, 2019, 6:17 a.m. |
OK |
GNU C++17 |
TESTS |
46 |
530 |
8806400 |
|
2900 |
64674561 |
vjudge2 |
F |
Nov. 11, 2019, 7:30 a.m. |
OK |
GNU C++17 |
TESTS |
46 |
560 |
8806400 |
|
2900 |
50717165 |
yzyyylx |
F |
March 3, 2019, 7:55 a.m. |
OK |
GNU C++17 |
TESTS |
46 |
590 |
19251200 |
|
2900 |
50734188 |
vjudge3 |
F |
March 3, 2019, 12:12 p.m. |
OK |
GNU C++17 |
TESTS |
46 |
592 |
19251200 |
|
2900 |
40457358 |
cbb |
F |
July 17, 2018, 1:33 a.m. |
OK |
GNU C++17 |
TESTS |
46 |
654 |
7987200 |
|
2900 |
59948272 |
Benq |
F |
Sept. 3, 2019, 1:40 p.m. |
OK |
GNU C++17 |
TESTS |
46 |
654 |
19660800 |
|
2900 |
59948125 |
Benq |
F |
Sept. 3, 2019, 1:37 p.m. |
OK |
GNU C++17 |
TESTS |
46 |
748 |
24576000 |
|
2900 |
54408082 |
ruo |
F |
May 20, 2019, 7:49 a.m. |
OK |
GNU C++17 |
TESTS |
46 |
842 |
18329600 |
|
2900 |
48408374 |
kczno1 |
F |
Jan. 15, 2019, 6:03 a.m. |
OK |
GNU C++17 |
TESTS |
46 |
1092 |
23961600 |
|
2900 |
4268219 |
ZaakDov |
F |
Aug. 12, 2013, 7:08 a.m. |
OK |
MS C++ |
TESTS |
46 |
530 |
16179200 |
|
2900 |
4268190 |
ZaakDov |
F |
Aug. 12, 2013, 6:59 a.m. |
OK |
MS C++ |
TESTS |
46 |
530 |
16179200 |
|
2900 |
remove filters
Back to search problems