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"Anna's got a birthday today. She invited many guests and cooked a huge (nearly infinite) birthday cake decorated by n banana circles of different sizes. Maria's birthday is about to start in 7 minutes too, and while Anna is older, she decided to play the boss a little. She told Maria to cut the cake by k straight-line cuts (the cutting lines can intersect) to divide banana circles into banana pieces. Anna has many guests and she wants everyone to get at least one banana piece. That's why she told Maria to make the total number of banana pieces maximum. It's not a problem if some banana pieces end up on the same cake piece -- the key is to make the maximum number of banana pieces. Determine what result Maria will achieve. The first line contains two integers n and k -- the number of banana circles and the number of cuts Maria should perform (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Next n lines contain the positions and sizes of the banana circles (all banana circles are round). On the cake the Cartesian coordinate system is defined. Each line contains three integers x, y and r -- the coordinates of the center of the corresponding banana piece and its radius ( xe2 x80 x89- xe2 x80 x891000 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x, xe2 x80 x89y xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000). It is guaranteed that the banana circles do not intersect, do not touch each other and do not overlap with each other. Pretest 10 is big test with n xe2 x80 x89= xe2 x80 x89k xe2 x80 x89= xe2 x80 x891000. Print the only integer -- the largest number of banana pieces that Maria can get after she performs the k straight-line cuts. Please do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specificator."... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
913602 |
coolinging |
E |
Dec. 2, 2011, 1:52 a.m. |
OK |
FPC |
TESTS |
102 |
1390 |
1126400 |
|
2900 |
1442665 |
WindIncarnation |
E |
March 30, 2012, 7:31 a.m. |
OK |
FPC |
TESTS |
102 |
1630 |
1228800 |
|
2900 |
912889 |
zanoes |
E |
Dec. 1, 2011, 12:49 p.m. |
OK |
FPC |
TESTS |
102 |
2160 |
1945600 |
|
2900 |
1356240 |
sillycross |
E |
March 14, 2012, 4:40 a.m. |
OK |
FPC |
TESTS |
102 |
2360 |
1331200 |
|
2900 |
876704 |
wayne-ho |
E |
Nov. 18, 2011, 1:10 a.m. |
OK |
GNU C++ |
TESTS |
102 |
1060 |
1638400 |
|
2900 |
876774 |
KiraZ |
E |
Nov. 18, 2011, 3:37 a.m. |
OK |
GNU C++ |
TESTS |
102 |
1080 |
1638400 |
|
2900 |
12288674 |
syc1999 |
E |
July 31, 2015, 8:17 a.m. |
OK |
GNU C++ |
TESTS |
102 |
1154 |
3993600 |
|
2900 |
871060 |
Jacob |
E |
Nov. 15, 2011, 10:07 a.m. |
OK |
GNU C++ |
TESTS |
102 |
1190 |
1740800 |
|
2900 |
880074 |
self_healing |
E |
Nov. 20, 2011, 7:08 a.m. |
OK |
GNU C++ |
TESTS |
102 |
1230 |
1638400 |
|
2900 |
2795199 |
lasten |
E |
Dec. 19, 2012, 3:20 p.m. |
OK |
GNU C++ |
TESTS |
102 |
1265 |
1638400 |
|
2900 |
11274042 |
Amr_Hassan |
E |
May 26, 2015, 6:02 a.m. |
OK |
GNU C++ |
TESTS |
102 |
1278 |
40038400 |
|
2900 |
991524 |
stx2 |
E |
Dec. 30, 2011, 4:15 a.m. |
OK |
GNU C++ |
TESTS |
102 |
1360 |
1638400 |
|
2900 |
877147 |
zpl2 |
E |
Nov. 18, 2011, 9:37 a.m. |
OK |
GNU C++ |
TESTS |
102 |
1390 |
1740800 |
|
2900 |
40992132 |
ReaLNero1 |
E |
July 31, 2018, 1:06 a.m. |
OK |
GNU C++ |
TESTS |
102 |
1466 |
307200 |
|
2900 |
12737371 |
Remilia-Scarlet |
E |
Aug. 29, 2015, 12:59 a.m. |
OK |
GNU C++11 |
TESTS |
102 |
1466 |
204800 |
|
2900 |
43460656 |
xuanquang1999 |
E |
Sept. 26, 2018, 4:53 p.m. |
OK |
GNU C++11 |
TESTS |
102 |
1652 |
204800 |
|
2900 |
18276557 |
AlexFetisov |
E |
June 6, 2016, 10:58 p.m. |
OK |
GNU C++11 |
TESTS |
102 |
1840 |
2457600 |
|
2900 |
16884725 |
freebsdx |
E |
March 23, 2016, 11 a.m. |
OK |
GNU C++11 |
TESTS |
102 |
1870 |
2560000 |
|
2900 |
18828631 |
TMC |
E |
June 30, 2016, 5:58 p.m. |
OK |
GNU C++11 |
TESTS |
102 |
1964 |
204800 |
|
2900 |
50042202 |
lalaxu |
E |
Feb. 17, 2019, 2:57 a.m. |
OK |
GNU C++11 |
TESTS |
102 |
3274 |
102400 |
|
2900 |
50042219 |
lalaxu |
E |
Feb. 17, 2019, 2:58 a.m. |
OK |
GNU C++11 |
TESTS |
102 |
3276 |
204800 |
|
2900 |
57903469 |
lopare |
E |
July 28, 2019, 4:38 p.m. |
OK |
GNU C++11 |
TESTS |
102 |
3338 |
102400 |
|
2900 |
50174246 |
xuzhiyuan |
E |
Feb. 19, 2019, 2:56 p.m. |
OK |
GNU C++11 |
TESTS |
102 |
3338 |
102400 |
|
2900 |
54497491 |
WOSHIGEPACHONG2 |
E |
May 22, 2019, 6:35 p.m. |
OK |
GNU C++11 |
TESTS |
102 |
3368 |
204800 |
|
2900 |
35838204 |
______n______ |
E |
March 2, 2018, 1:28 p.m. |
OK |
GNU C++14 |
TESTS |
102 |
1340 |
2150400 |
|
2900 |
35838200 |
______u______ |
E |
March 2, 2018, 1:28 p.m. |
OK |
GNU C++14 |
TESTS |
102 |
1340 |
2150400 |
|
2900 |
35838122 |
_____i_____ |
E |
March 2, 2018, 1:27 p.m. |
OK |
GNU C++14 |
TESTS |
102 |
1340 |
2150400 |
|
2900 |
35838101 |
_____k_____ |
E |
March 2, 2018, 1:27 p.m. |
OK |
GNU C++14 |
TESTS |
102 |
1340 |
2150400 |
|
2900 |
35831639 |
______h______ |
E |
March 2, 2018, 9:52 a.m. |
OK |
GNU C++14 |
TESTS |
102 |
1340 |
2150400 |
|
2900 |
35831600 |
______k______ |
E |
March 2, 2018, 9:52 a.m. |
OK |
GNU C++14 |
TESTS |
102 |
1340 |
2150400 |
|
2900 |
35831578 |
______i______ |
E |
March 2, 2018, 9:51 a.m. |
OK |
GNU C++14 |
TESTS |
102 |
1340 |
2150400 |
|
2900 |
35830167 |
______M______ |
E |
March 2, 2018, 9:05 a.m. |
OK |
GNU C++14 |
TESTS |
102 |
1340 |
2150400 |
|
2900 |
23670860 |
Ali.Pi |
E |
Jan. 9, 2017, 8:41 p.m. |
OK |
GNU C++14 |
TESTS |
102 |
1372 |
2048000 |
|
2900 |
37479627 |
kut_kjb1994 |
E |
April 20, 2018, 7:20 a.m. |
OK |
GNU C++14 |
TESTS |
102 |
1558 |
4096000 |
|
2900 |
41740377 |
ruo |
E |
Aug. 18, 2018, 5:13 a.m. |
OK |
GNU C++17 |
TESTS |
102 |
2182 |
204800 |
|
2900 |
2049667 |
Soldat |
E |
Aug. 26, 2012, 7:48 a.m. |
OK |
Java 6 |
TESTS |
102 |
2690 |
44236800 |
|
2900 |
870626 |
tomek |
E |
Nov. 15, 2011, 9:09 a.m. |
OK |
Java 6 |
TESTS |
102 |
3230 |
43110400 |
|
2900 |
969080 |
zjut_DD |
E |
Dec. 20, 2011, 8:49 a.m. |
OK |
MS C++ |
TESTS |
102 |
610 |
1638400 |
|
2900 |
969059 |
zjut_DD |
E |
Dec. 20, 2011, 8:28 a.m. |
OK |
MS C++ |
TESTS |
102 |
1780 |
1638400 |
|
2900 |
remove filters
Back to search problems