CF164E.Polycarpus and Tasks
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The first line of the input contains a single integer n ( 1<=n<=105 ) — the number of tasks in set A .
Then n lines describe the tasks. The i -th line contains three space-separated integers li , ri , ti ( 1<=li<=ri<=109 , 1<=ti<=ri−li+1 ) — the description of the i -th task.
It is guaranteed that for any tasks j,k (considering that j<k ) the following is true: l_{j}<l_{k} and r_{j}<r_{k} .
输入格式
For each task i print a single integer — the result of processing task i on the i -th iteration of the cycle (step 3) in function f(A) . In the i -th line print:
- 0 — if you managed to add task i on step 4.
- -1 — if you didn't manage to add or replace task i (step 7).
- resi ( 1<=resi<=n ) — if you managed to replace the task (step 6): resi equals the task number (in set A ), that should be chosen as bk and replaced by task ai .
输出格式
无
输入输出样例
输入#1
5 1 8 5 2 9 3 3 10 3 8 11 4 11 12 2
输出#1
0 0 1 0 -1
输入#2
13 1 8 5 2 9 4 3 10 1 4 11 3 8 12 5 9 13 5 10 14 5 11 15 1 12 16 1 13 17 1 14 18 3 15 19 3 16 20 2
输出#2
0 0 0 2 -1 -1 0 0 0 0 7 0 12