QOJ.ac

QOJ

시간 제한: 0.2 s 메모리 제한: 256 MB 총점: 100

#15569. 马拉松

통계

你开始练习长跑。简单来说,运动员比赛的道路是一条笔直的、无限长的直线。在某个时刻,所有参赛者分成了 $n$ 个组,每组有 $k_i$ 个人。

在此时刻,每个组都位于坐标 $x_i$ 处。我们知道,如果一个组由 $D$ 个人组成,那么该组的速度为 $100/D$。所有组都沿着坐标增加的方向移动。如果一个队伍追上了另一个队伍,它们就会合并,并且它们的速度也会相应地改变(两个以上的组可以同时合并)。

由于道路是无限长的,从某个时间点开始,将不再可能发生合并。

作为一名初学者,你对最终剩下的组数以及每个组中的人数感兴趣。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 10^5$)。

接下来的 $n$ 行,每行包含相应组的人数 $k_i$ 和它的坐标 $x_i$($x_i$ 为实数,最多保留三位小数,且其绝对值不超过 $10^4$;$1 \le k_i \le 100$,所有坐标互不相同)。

输出格式

输出的第一行包含一个整数 $m$,表示最终剩下的组数。

第二行包含 $m$ 个整数,表示每个组中的人数,可以按任意顺序输出。

样例

输入样例 1

4
1 0
2 9000
4 1
3 10000

输出样例 1

2
5 5

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.