CF958D1.Hyperspace Jump (easy)

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The Rebel fleet is on the run. It consists of mm ships currently gathered around a single planet. Just a few seconds ago, the vastly more powerful Empire fleet has appeared in the same solar system, and the Rebels will need to escape into hyperspace. In order to spread the fleet, the captain of each ship has independently come up with the coordinate to which that ship will jump. In the obsolete navigation system used by the Rebels, this coordinate is given as the value of an arithmetic expression of the form .

To plan the future of the resistance movement, Princess Heidi needs to know, for each ship, how many ships are going to end up at the same coordinate after the jump. You are her only hope!

输入格式

The first line of the input contains a single integer mm ( 1<=m<=2000001<=m<=200000 ) – the number of ships. The next mm lines describe one jump coordinate each, given as an arithmetic expression. An expression has the form (a+b)/c. Namely, it consists of: an opening parenthesis (, a positive integer aa of up to two decimal digits, a plus sign +, a positive integer bb of up to two decimal digits, a closing parenthesis ), a slash /, and a positive integer cc of up to two decimal digits.

输出格式

Print a single line consisting of mm space-separated integers. The ii -th integer should be equal to the number of ships whose coordinate is equal to that of the ii -th ship (including the ii -th ship itself).

输入输出样例

  • 输入#1

    4
    (99+98)/97
    (26+4)/10
    (12+33)/15
    (5+1)/7
    

    输出#1

    1 2 2 1 

说明/提示

In the sample testcase, the second and the third ship will both end up at the coordinate 33 .

Note that this problem has only two versions – easy and hard.

首页