<PREV Problem:
NEXT>
Solved by 46 users: vi002, marek.cygan, dan, LoLitter, Moonlight, zmy, Rizvanov, JohnJones_001, lutyj, littleboy, WsemirZ, davidsun, Cheryl, Chmeli_BSU, tourist, pmnox, shangjingbo, zloy_mipt, KZ, turbovenik, stas_flash, trickster, XP31, mazahaka, outlaw, MIKseR, defrager, RAVEman, Ravent, murphy, TTLovePP, Dest, EAA2008, ripatti, FMSnew, Kuznetsov_S, Irkhin, vitar, LiuChenheng, abortmozga.ru, Azizkhan, Madiyar_Tktl, NIGHTFIT, dragonic, adamant, Bekzhan.Kassenov.
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Range Query

Time limit = 6 second(s)

Memory limit = 60 Mb

Your program should execute queries on setting and unsetting points on the plane.

All coordinates are integer numbers from [-2'000'000'000, 2'000'000'000];

Input No more than 100000 commands.

Output Commands' outputs. Number of lines in output should be equal to number of lines in input.

Input#1
ADD 1 1
ADD 1 2
ADD 1 3
ADD 2 1
ADD 2 2
ADD 2 3
ADD 3 1
ADD 3 2
ADD 3 3
ADD 2 2
COUNT 1 1 3 3
COUNT 1 1 2 2
COUNT 1 1 1 1
DELETE 2 2
COUNT 1 1 3 3
COUNT 1 1 2 2
COUNT 1 1 1 1
DELETE 2 2
COUNT 2 2 2 2

Output#1
ADDED
ADDED
ADDED
ADDED
ADDED
ADDED
ADDED
ADDED
ADDED
ALREADY EXISTS
9
4
1
DELETED
8
3
1
NOT FOUND
0

Author:
Andrey Lokot'
10 March 2007

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 200ms

SW soft NIX
ID = 23.20.13.165