#P8661. [蓝桥杯 2018 省 B] 日志统计
[蓝桥杯 2018 省 B] 日志统计
Description
Xiaoming maintains a programmer forum. Now he has collected a set of "like" logs with a total of lines. Each line is in the format ts id, meaning that at time , the post with number received one "like".
Now Xiaoming wants to count which posts have ever been "hot posts". If a post has received at least likes within any time period of length , Xiaoming considers that this post has once been a "hot post".
More specifically, if there exists a time such that the post receives at least likes during the time interval (note that it is a left-closed right-open interval), then this post has once been a "hot post".
Given the logs, please help Xiaoming list the IDs of all posts that have ever been "hot posts".
Input Format
The first line contains three integers , , and .
The following lines each contain one log entry, with two integers and .
Output Format
Output the IDs of hot posts in increasing order. Print one per line.
7 10 2
0 1
0 10
10 10
10 1
9 1
100 3
100 3
1
3
Hint
For of the testdata, .
For of the testdata, , and .
Time limit: 1 second, 256 MB. Lanqiao Cup 2018, 9th Provincial Contest.
Translated by ChatGPT 5
京公网安备 11011102002149号