Anda di halaman 1dari 2

6/23/2014 SPOJ.

com - Problem DIVCON


http://www.spoj.com/problems/DIVCON/ 1/2
User:
Password:
for today
Log In
register
tutorials
status
submit
problems
search
news
contests
ranks
forum
tools
clusters
credits
jobs
Server time:
2014-06-23
08 : 52 : 44
Submit All submissions Best solutions PS PDF Back to list
Added by: Stjepan Glavina
Date: 2010-04-26
Time limit: 5s
Source limit: 50000B
Memory limit: 256MB
Cluster: Pyramid (Intel Pentium III 733 MHz)
Languages: All except: NODEJS PERL 6
Resource: authors: Filip Paveti, Adrian Satja Kurdija
SPOJ Problem Set (classical)
6576. Divide and conquer
Problem code: DIVCON
Anne and Brenda found some cookies scattered on the lattice points in the 2D coordinate system. They
agreed to divide them in the following manner.
First, Anne draws a vertical line (that is, a line with the equation x = c, for any real number c) somewhere
in the plane. Then Brenda draws a horizontal line (y = d) somewhere in the plane. Now they have divided
the plane in four quadrants.
Anne gets all the cookies lying in the upper right and the lower left quadrant, and Brenda gets all the
cookies lying in the upper left and the lower right quadrant. Cookies which lie on the vertical or the
horizontal line are ignored.
Anne's goal is to maximize the number of cookies she gets, knowing that Brenda plays optimally (in order
to maximize her number of cookies).
Input
In the first line of input there is an integer T (1 T 600), the number of test cases.
Each test case starts with an integer N (1 N 1000), the number of cookies. In the next N lines there
are coordinates (Xi, Yi) of the cookies, integers in the interval [1, 1000]. There can be multiple cookies at
the same point.
Output
For each of the T cases, output in a separate line the maximal number of cookies Anne can surely get.
Example
Input:
2
5
1 1
4 1
4 5
5 1
3 3
11
7 10
7 11
7 10
7 11
6 6
5 5
4 8
1 5
1 6
1 4
7 1
Output:
2
5
hide comments
2011-09-09 10:38:32 Adrian Satja Kurdija
@HELLO: real.
0
Time for a new job?
6/23/2014 SPOJ.com - Problem DIVCON
http://www.spoj.com/problems/DIVCON/ 2/2
About SPOJ width: 900 1024 Full theme: olive banana plum hspl #spoj at freenode RSS
Spoj.com. All Rights Reserved. Spoj uses Sphere Engine by Sphere Research Labs.
2011-08-08 11:43:57 HELLO
problem setter or someone please tell me here d is an integer or real no
2011-07-13 09:03:18 Tony Beta Lambda
@Ashrut: x = 5.5
Last edit: 2011-07-13 09:03:46
2011-01-12 17:45:19 Ashrut Tewari
I m getting answer 4 for test case 2, can anybody explain how is it 5 ? Which column is selected by
Anne ?

Anda mungkin juga menyukai