### MaGaroo's blog

By MaGaroo, history, 4 years ago,

Hi!
There is a contest at AZsPCs which has started on 10 Dec 2016 and will end on 11 Mar 2017.
In AZsPCs you should submit just the output of your code(even if you have no code :D), and there is no need to submit your source code!
Anyway! Just register and try it, if you're interested :)

UPD: "AZsPCs" stands as an acronym for "Al Zimmermann's Programming Contests".

• +56

By MaGaroo, history, 5 years ago,

Hello :)
This(14612490) is a brute force solution for 506D - Mr. Kitayuta's Colorful Graph and it's time complexity is absolutely O(n^2). (n <= 100 * 1000)
I submitted it and got AC!
Could someone help me? Why did it happen? Weak test data or fast servers?
(That code must get TLE if we give it a path of size 100 * 1000 and all edges with the same color without any query)

• -1

By MaGaroo, 6 years ago,

Hello!
Can someone help me to solve this problem? :/
"Soosk" has n candies, the i th candy with weight w[i]. He has a Merger machine that in each move receives two candies with weights X and Y, Then he pays X + Y dollars and the Merger makes a new candy with weight X + Y. Certainly after each Merge the number of candies decreases by one. Soosk wants to Merge all candies(in n-1 moves!) that in the end, he's paid the least possible amount of money.
1) What is the best algorithm for this problem?
2) If S = w[1] + w[2] + ... + w[n], how much money Soosk has to pay in the worst case?
3) If S = w[1] + w[2] + ... + w[n], what is average amount of money Soosk has to pay? (sorry for bad English)

• +5

By MaGaroo, 6 years ago,

Hi there!
Last night I saw this problem in "Timus". I knew that it can be solved by Segment Tree, so I wrote this code. But it gets "Wrong answer on test 3" :-"
Can you tell me where it's bug is?!

• -1

By MaGaroo, 6 years ago,

How I feel, when first attemption gets "Accepted" verdict (or sth like this)