|Online MIPT programming contest||РУССКИЙ|
Time limit = 4 second(s)
Memory limit = 64 MbStock market securities have many properties such as floating price, volatility, liquidity, etc. Also one may estimate their mean profitability, growth potential, etc.
WebMarket is a managing company of a stock exchange. It provides trading facilities for stock brokers and traders, services for issue and redemption of securities as well as other financial instruments and capital events including payment of income and dividends.
WebMarket analysts introduce a new market index called
WebMarket analysts decide to make the reliability index public and provide a service of buying the security with the K-th highest value of reliability. According to WebMarket analysts this instrument will attract more clients and increase the market turnover.
Reliability estimation algorithms are already baked. Your task is to write a program that manipulates the reliability index list. The securities are listed in the decreasing order of reliability. The securities with equal reliabilities are listed in the increasing order of their ids.
Securities in the Webmarket database have three attributes:
For each new security, the value of id is automatically assigned to the next available id. Initial value of reliability is 0. If a security is removed its id is never reused.
The following requests should be supported: issuing a new security, removing a security from the database, changing the value of reliability for an existing security, and finding the K-th security in the reliability index list.
The first line contains the number of requests N (0 ≤ N ≤ 100000). The next N lines contain requests, one per line. A request has one of the following four forms.
Your program should respond with one line for each request.
17 ISSUE aaa FIND 10 ISSUE bbb ISSUE ccc RELIABILITY aaa 10 RELIABILITY bbb 30 RELIABILITY ccc 20 RELIABILITY xxx 20 FIND 1 FIND 2 FIND 0 ISSUE eee ISSUE fff FIND 3 FIND 111 DELETE bbb FIND 0
CREATED 0 0 OK aaa 0 0 CREATED 1 0 CREATED 2 0 OK 0 10 OK 1 30 OK 2 20 BAD REQUEST OK ccc 2 20 OK aaa 0 10 OK bbb 1 30 CREATED 3 0 CREATED 4 0 OK eee 3 0 OK fff 4 0 OK 1 30 OK ccc 2 20
ACM ICPC 2008-2009, Moscow Subregional Contest, Moscow, October 26, 2008.
26 October 2008
© acm.mipt DevGroup
The page was generated in 190ms