ผลต่างระหว่างรุ่นของ "01204212/like"

จาก Theory Wiki
ไปยังการนำทาง ไปยังการค้นหา
(หน้าที่ถูกสร้างด้วย ': ''This is part of 01204212'' You want to keep track of the number of "likes" each status has. In the beginning, every status ha...')
 
แถว 1: แถว 1:
 
: ''This is part of [[01204212]]''
 
: ''This is part of [[01204212]]''
  
You want to keep track of the number of "likes" each status has.  In the beginning, every status has 0 likes.
+
You want to keep track of the number of "likes" each status has.  In the beginning, every status has 0 likes.  You are given a sequence of like clicks (as a sequence of status IDs).
 +
 
 +
'''Input'''
 +
 
 +
* First line: an integer '''N''' (1<='''N'''<=100,000)
 +
* The next '''N''' lines: each line contains an integer '''x''', the ID of the post clicked.
 +
 
 +
'''Output'''
 +
 
 +
There are '''N''' lines of output, each contains the current number of likes the post ID '''x''' has so far (including this one).

รุ่นแก้ไขเมื่อ 21:07, 21 กันยายน 2559

This is part of 01204212

You want to keep track of the number of "likes" each status has. In the beginning, every status has 0 likes. You are given a sequence of like clicks (as a sequence of status IDs).

Input

  • First line: an integer N (1<=N<=100,000)
  • The next N lines: each line contains an integer x, the ID of the post clicked.

Output

There are N lines of output, each contains the current number of likes the post ID x has so far (including this one).