Canada Cup 2016

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
725 Canada Cup 2016 FINISHED False 9000 254674499 Oct. 22, 2016, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 539 ) F Family Photos PROGRAMMING games greedy 2900

B"Alice and Bonnie are sisters, but they don't like each other very much. So when some old family photos were found in the attic, they started to argue about who should receive which photos. In the end, they decided that they would take turns picking photos. Alice goes first. There are n stacks of photos. Each stack contains exactly two photos. In each turn, a player may take only a photo from the top of one of the stacks. Each photo is described by two non-negative integers a and b, indicating that it is worth a units of happiness to Alice and b units of happiness to Bonnie. Values of a and b might differ for different photos. It's allowed to pass instead of taking a photo. The game ends when all photos are taken or both players pass consecutively. The players don't act to maximize their own happiness. Instead, each player acts to maximize the amount by which her happiness exceeds her sister's. Assuming both players play optimal, find the difference between Alice's and Bonnie's happiness. That is, if there's a perfectly-played game such that Alice has x happiness and Bonnie has y happiness at the end, you should print x xe2 x80 x89- xe2 x80 x89y. The first line of input contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000) -- the number of two-photo stacks. Then follow n lines, each describing one of the stacks. A stack is described by four space-separated non-negative integers a1, b1, a2 and b2, each not exceeding 109. a1 and b1 describe the top photo in the stack, while a2 and b2 describe the bottom photo in the stack. Output a single integer: the difference between Alice's and Bonnie's happiness if both play optimally. "...

Tutorials

Canada Cup Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
21786665 MintGreen F Oct. 26, 2016, 4:26 a.m. OK FPC TESTS 26 78 1638400 2900
21701634 Tommyr7 F Oct. 23, 2016, 8:09 a.m. OK FPC TESTS 26 93 1638400 2900
21868710 s34vv1nd F Oct. 29, 2016, 10:02 a.m. OK FPC TESTS 26 108 1740800 2900
28892432 zhouhebin F July 26, 2017, 3:08 a.m. OK GNU C++ TESTS 26 31 3686400 2900
22203322 yuanxinyu402 F Nov. 14, 2016, 6:44 a.m. OK GNU C++ TESTS 26 46 614400 2900
21762892 ShallWe F Oct. 25, 2016, 3:37 a.m. OK GNU C++ TESTS 26 46 1024000 2900
21918972 MrDindows F Oct. 31, 2016, 1:53 p.m. OK GNU C++ TESTS 26 46 1536000 2900
28892409 zhouhebin F July 26, 2017, 3:06 a.m. OK GNU C++ TESTS 26 46 2867200 2900
28892613 vjudge1 F July 26, 2017, 3:15 a.m. OK GNU C++ TESTS 26 46 2867200 2900
26593868 jiyutian F April 23, 2017, 2:23 a.m. OK GNU C++ TESTS 26 46 3481600 2900
28892622 vjudge3 F July 26, 2017, 3:16 a.m. OK GNU C++ TESTS 26 46 3686400 2900
24907448 Dylans F Feb. 23, 2017, 3:07 a.m. OK GNU C++ TESTS 26 46 3686400 2900
41009906 chengni F July 31, 2018, 12:03 p.m. OK GNU C++ TESTS 26 46 80179200 2900
21917974 bciobanu F Oct. 31, 2016, 1:10 p.m. OK GNU C++11 TESTS 26 31 1433600 2900
60304039 nealchen F Sept. 9, 2019, 1:12 p.m. OK GNU C++11 TESTS 26 31 1536000 2900
21916821 VAVAvile F Oct. 31, 2016, 12:24 p.m. OK GNU C++11 TESTS 26 31 1536000 2900
52521870 LuciferX07 F April 9, 2019, 9:12 a.m. OK GNU C++11 TESTS 26 46 614400 2900
52522019 vjudge1 F April 9, 2019, 9:18 a.m. OK GNU C++11 TESTS 26 46 614400 2900
40969286 xiezichen F July 30, 2018, 12:39 p.m. OK GNU C++11 TESTS 26 46 614400 2900
40983434 ReaLNero1 F July 30, 2018, 6:52 p.m. OK GNU C++11 TESTS 26 46 1433600 2900
21918060 bciobanu F Oct. 31, 2016, 1:13 p.m. OK GNU C++11 TESTS 26 46 1433600 2900
21918967 MrDindows F Oct. 31, 2016, 1:53 p.m. OK GNU C++11 TESTS 26 46 1536000 2900
21919059 MrDindows F Oct. 31, 2016, 1:57 p.m. OK GNU C++11 TESTS 26 46 1536000 2900
21918050 bciobanu F Oct. 31, 2016, 1:13 p.m. OK GNU C++14 TESTS 26 31 1638400 2900
21918762 MrDindows F Oct. 31, 2016, 1:45 p.m. OK GNU C++14 TESTS 26 46 1638400 2900
21815652 AlexandruVlad F Oct. 27, 2016, 9:11 a.m. OK GNU C++14 TESTS 26 93 819200 2900
22003482 ErdemKirez F Nov. 2, 2016, 11:22 p.m. OK GNU C++14 TESTS 26 93 2355200 2900
28666593 Flash-boy F July 18, 2017, 11:39 a.m. OK GNU C++14 TESTS 26 93 2867200 2900
27206735 vjudge1 F May 19, 2017, 2:47 a.m. OK GNU C++14 TESTS 26 108 921600 2900
21917085 VAVAvile F Oct. 31, 2016, 12:35 p.m. OK GNU C++14 TESTS 26 108 1638400 2900
26221191 olekluka F April 8, 2017, 2:27 p.m. OK GNU C++14 TESTS 26 109 3584000 2900
21713474 Grunt F Oct. 23, 2016, 1:18 p.m. OK GNU C++14 TESTS 26 109 3993600 2900
29965022 vjudge5 F Sept. 1, 2017, 6:03 a.m. OK GNU C++14 TESTS 26 109 5120000 2900
69948968 hjk1030 F Feb. 1, 2020, 8:24 a.m. OK GNU C++17 TESTS 26 108 1638400 2900
69928153 swacisko F Jan. 31, 2020, 9:36 p.m. OK GNU C++17 TESTS 26 140 1638400 2900
57074117 Benq F July 15, 2019, 4:12 a.m. OK GNU C++17 TESTS 26 140 3174400 2900
36197774 UncleGrandpa F March 11, 2018, 11:44 a.m. OK GNU C++17 TESTS 26 156 5017600 2900
58714918 .I. F Aug. 13, 2019, 1:41 p.m. OK GNU C++17 TESTS 26 1325 3174400 2900
21770979 uwi F Oct. 25, 2016, 12:39 p.m. OK Java 8 TESTS 26 187 0 2900
21681316 eatmore F Oct. 22, 2016, 4:23 p.m. OK Java 8 TESTS 26 233 0 2900
21686034 Lewin F Oct. 22, 2016, 5:03 p.m. OK Java 8 TESTS 26 343 4198400 2900
21715860 stevie1024 F Oct. 23, 2016, 3:16 p.m. OK Java 8 TESTS 26 514 16486400 2900
52663439 vjudge5 F April 13, 2019, 2:31 a.m. OK MS C++ TESTS 26 78 1638400 2900
21778801 Cherser F Oct. 25, 2016, 6:33 p.m. OK MS C++ TESTS 26 390 1433600 2900
21777238 Chortos-2 F Oct. 25, 2016, 5:30 p.m. OK PyPy 2 TESTS 26 452 7680000 2900
21777786 Chortos-2 F Oct. 25, 2016, 5:55 p.m. OK PyPy 2 TESTS 26 467 7680000 2900
21777251 Chortos-2 F Oct. 25, 2016, 5:31 p.m. OK Python 2 TESTS 26 592 4300800 2900

remove filters

Back to search problems