GlobeX Cup '19 S1 - Planet Classification
View as PDFAndy is travelling through the galaxy. His mission is to categorize the planets that he passes. There are  types of planets. He passes by 
 different planets. Each of these planets can be classified as one of these 
 types. You would like to help Andy on his mission by programming a computer assistant for him. Whenever he passes a planet, he will tell the assistant the type of this planet. The assistant must then tell him how many previous planets are of this type. At the end of his journey, the assistant must also report the total different types of planets that he has passed by.
Input Specification
Line : 
 and 
, separated by a single space.
Line  to 
: 
, the type of the planet that he has passed, where 
 is the line number.
Output Specification
Line  to 
: 
, the number of previous planets that are of type 
, where 
 is the line number.
Line : 
, the total number of different types of planets that Andy has passed.
Constraints
Subtasks
Subtask 1 [10%]
Subtask 2 [10%]
Subtask 3 [80%]
No additional constraints.
Sample Input
5 4
1
4
4
3
4
Sample Output
0
0
1
0
2
3
Comments
for python 3, try using a dictionary instead of a list