查看原帖
95103
KellyFrog楼主2020/4/9 16:09

输入格式

The first line of the input contains an integer nn (1n2×1051\le n \le 2\times10^5) — the number of participants and bids.

Each of the following nn lines contains two integers aia_i and bib_i ( 1ain1\le a_i\le n,1bi1091\le b_{i}\le 10^{9},bi<bi+1b_{i}<b_{i+1} ) — the number of participant who made the ii-th bid and the size of this bid.

Next line contains an integer qq ( 1q2×1051\le q\le 2\times 10^5) — the number of question you have in mind.

Each of next qq lines contains an integer kk ( 1kn1\le k \le n), followed by kk integersljl_{j}(1ljn1\le l_j \le n) — the number of people who are not coming in this question and their indices. It is guarenteed that ljl_j.

values are different for a single question.

It's guaranteed that the sum of kk over all question won't exceed 2×1052\times 10^5.

输出格式

For each question print two integer — the index of the winner and the size of the winning bid. If there is no winner (there are no remaining bids at all), print two zeroes.

题意翻译

一场拍卖会,共nn个买家。这些买家共出价nn次,有的买家可能一次都没有出价。

每次出价用(ai,bi)(a_i,b_i)表示,aia_i为此次出价人的编号,bib_i为价格。

出价严格递增(bi<bi+1b_i<b_{i+1})并且没有玩家在一轮竞拍中在没有其他竞争对手的情况下自动增加自己的出价(aiai+1a_i \neq a_{i+1})。

现在给定qq次查询,每次去掉一些出价者及其所有出价,问最后谁是赢家并且他以什么价格赢得拍卖品。

### 输入格式
The first line of the input contains an integer $n$ ($1\le n \le 2\times10^5$) — the number of participants and bids.

Each of the following $n$ lines contains two integers $a_i$
  and $b_i$
  ( $1\le a_i\le n$,$1\le b_{i}\le 10^{9}$,$b_{i}<b_{i+1}$ ) — the number of participant who made the $i$-th bid and the size of this bid.

Next line contains an integer $q$ ( $1\le q\le 2\times 10^5$) — the number of question you have in mind.

Each of next qq lines contains an integer $k$ ( $1\le k \le n$), followed by $k$ integers$l_{j}$($1\le l_j \le n$) — the number of people who are not coming in this question and their indices. It is guarenteed that $l_j$.

values are different for a single question.

It's guaranteed that the sum of $k$ over all question won't exceed $2\times 10^5$.
### 输出格式
For each question print two integer — the index of the winner and the size of the winning bid. If there is no winner (there are no remaining bids at all), print two zeroes.
### 题意翻译
一场拍卖会,共$n$个买家。这些买家共出价$n$次,有的买家可能一次都没有出价。

每次出价用$(a_i,b_i)$表示,$a_i$为此次出价人的编号,$b_i$为价格。

出价严格递增($b_i<b_{i+1}$)并且没有玩家在一轮竞拍中在没有其他竞争对手的情况下自动增加自己的出价($a_i \neq a_{i+1}$)。

现在给定$q$次查询,每次去掉一些出价者及其所有出价,问最后谁是赢家并且他以什么价格赢得拍卖品。
2020/4/9 16:09
加载中...