MaGaroo's blog

By MaGaroo, history, 4 years ago, In English

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".

Read more »

 
 
 
 
  • Vote: I like it
  • +56
  • Vote: I do not like it

By MaGaroo, history, 5 years ago, In English

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)

Read more »

 
 
 
 
  • Vote: I like it
  • -1
  • Vote: I do not like it

By MaGaroo, 6 years ago, In English

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)

Read more »

 
 
 
 
  • Vote: I like it
  • +5
  • Vote: I do not like it

By MaGaroo, 6 years ago, In English

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?!

Read more »

 
 
 
 
  • Vote: I like it
  • -1
  • Vote: I do not like it

By MaGaroo, 6 years ago, In English

How I feel, when first attemption gets "Accepted" verdict (or sth like this)
http://www.weblogma.com/tempdir/uploads/2014/01/code-08.gif

Read more »

 
 
 
 
  • Vote: I like it
  • +8
  • Vote: I do not like it