Problem 547C "Wrong answer on test 3"

Правка en1, от l_l, 2015-06-05 12:24:06

Hello,

I have solved Question 547C, but when I submit my answer it gives me runtime error for gnuG++11 and wrong answer on test three for gnuG++ even though the test case works for me.

Here's a link to my submission:

http://codeforces.net/contest/547/submission/11443674

Basically, my approach to this problem is that I save the relation between all foam heights (whether coprime or not) in a two-dimensional vector "bool coprime". Then using that info I update the new score by calculating the difference in score after a beer is placed or removed. The time complexity of this approach is O(n^2).

I would appreciate it if anyone can figure out what's going on.

Thanks

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский l_l 2015-06-05 12:24:06 773 Initial revision (published)