SHAHBG - SHAHBAG
They say "History repeats itself" and this is what happening in Bangladesh on Feb 2013. Mass people fought the war in 1971 and now they are rising again to fight war criminals who betrayed the country. In "Shahbag" you can hear the voice of people wanting justice.
If you go to shahbag you can see many human chains. For this problem we imagine a straight line going through middle of shahbag. Each position of the line is marked from 1 to 20000.
People are forming human chains along the line. Initially every position is empty. When someone stands in ithposition he holds hand of people who are standing in his left and right(if there any) and join there group. If there are no people beside him, he forms a new group.
When a new people come your job is to mark his position and count currently how many groups are there in shahbag.
For example suppose:
- a man came first and stood in postion 2. Currently there are only 1 group.
- then another man stood in position 4. Currently there are 2 groups.
- another man stood in position 3. Now there are only 1 group.
And yes, people won't leave until they get justice, so no need to worry about that. mi
Input
There will be a single case. First line will contain an integer Q which denotes number of people. Next line will contain Q (1 <= Q <= 20000) integers pi which denotes position of i-th people that joined the chain. Each pi will be distinct and at most 20000.
Output
For each pi print number of groups currently in shahbag. In last line print the string "Justice" with a newline. Do not print any extra spaces.
Example
Sample Input: 6 2 4 3 6 7 5 Sample output: 1 2 1 2 2 1 Justice
Note:
This problem is based on true event. You can find the details here.
Alternate writer: Rashedul Hasan Rijul
hide comments
btm:
2013-02-15 12:29:05
move to tutorial man .such an easy task |
|
Kevin Sebastian:
2013-02-14 11:07:19
@author please help with judge 14..getting WA repeatedly |
|
Vipul Pandey:
2013-02-17 06:45:40
easy one! |
|
Shafaet:
2013-02-13 13:06:48
I've said "Each position of the line is marked from 1 to 20000.", as it is fixed, pi>Q is reasonable. |
|
Shafaet:
2013-02-13 13:06:48
@Everyone: I've intentionally made this problem "too easy" to let the world know about the historic event currently taking place in Bangladesh. Please see the link below the problem. |
|
(Tjandra Satria Gunawan)(曾毅昆):
2013-02-13 13:06:48
@jab tak hai jaan: I just give the idea.. This problem is too easy and not interesting :-P The constraints must be increased to make this more challenging.. |
|
Akb:
2013-02-13 13:06:48
@Tjandra: please leave the constraints of the problem to be decided by the setter himself... |
|
(Tjandra Satria Gunawan)(曾毅昆):
2013-02-13 13:06:48
too easy problem, may will be moved to tutorial section... It's will become interesting problem if the constraints for Pi increased to 10^18, and Q to 100000. Could you set that problem?
|
Added by: | Shafaet |
Date: | 2013-02-11 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |