ramanav1618's blog

By ramanav1618, history, 15 months ago, In English

my submission: https://codeforces.me/contest/2119/submission/327632426

My code fails on test 2's 1879th token. I do not understand whats wrong with it and how it fails at one particular point even though it seems fine to me. Lots of people failed this problem on test 2. Can someone tell me what's wrong with my code?

Thanks, Ramanav.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
15 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it
  1. use int as much as possible
  2. minimum bound needs to be as close to starting point as possible, think about how you can reach this statement
  • »
    »
    15 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    Why the first point?

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      usually, when it comes to some kind of computational geometry, I try to perform as many calculations as possible in integers, firstly they are faster, I'm not quite sure that I understand what is under the hood of real transformations, but there were many moments when I got TLE on them, I also find this option much more convenient, especially in this problem, where it is enough to square the remaining boundaries

    • »
      »
      »
      15 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      FPE. Better to write like 15 more lines than to gamble AC by doing sqrt().