Is there anyone who wants to tell their ideas?
Let me start it:
Problem 1:
Honestly, I have found the formula but I don't understand it, so I skip it.
If you got the formula for Q(n)..
where Q(n)= number of square-free<=n..
You can do binary search to get the answer.
Problem 2:
It is quite hard to implement. Find the outer cycles, then eliminate it find again some outer cycles in previous cycle. Subtract the related outer area with cycled found inside it.. do till no cycles =_="
Problem 3:
It's BIT(Binary Indexed Tree).
You can start learning BIT by solving MATSUM and z-green..
My algorithm is as follow:
my index:1- based(start from 1)
1. sort by name
2. for i=1..n
tmp=query to find numbers of names<name-i(after sorted) and in front of name-i (before sorted).
save tmp to variable a[position of string n before sorted]
update the ith sorted names.
3. print a from 1..n
Thanks to friends who post their ideas.
Let me start it:
Problem 1:
Honestly, I have found the formula but I don't understand it, so I skip it.
If you got the formula for Q(n)..
where Q(n)= number of square-free<=n..
You can do binary search to get the answer.
Problem 2:
It is quite hard to implement. Find the outer cycles, then eliminate it find again some outer cycles in previous cycle. Subtract the related outer area with cycled found inside it.. do till no cycles =_="
Problem 3:
It's BIT(Binary Indexed Tree).
You can start learning BIT by solving MATSUM and z-green..
My algorithm is as follow:
my index:1- based(start from 1)
1. sort by name
2. for i=1..n
tmp=query to find numbers of names<name-i(after sorted) and in front of name-i (before sorted).
save tmp to variable a[position of string n before sorted]
update the ith sorted names.
3. print a from 1..n
Thanks to friends who post their ideas.