1guptagaurav's blog

By 1guptagaurav, history, 3 months ago, In English

During today's Div2A contest, I encountered an issue with one of the questions. I wrote the expression ceil((n) / (c * 1.0)), which gave me a wrong answer on the second test case. This was really frustrating, and it ended up ruining my performance in the contest. After the system testing, I discovered the issue: the output format expected an integer, but I got something like "1e+009" instead. That’s when I realized I needed to cast the result to long long. Once I updated the code to (long long)(ceil((n) / (c * 1.0))) after the contest, it worked and got accepted.

During the contest, I was wasting time trying to find the problematic test case, when the real issue was my misunderstanding of the built-in functions. This experience taught me how important it is to fully understand the functions you're using. Today, I realized that participating in contests teaches you a lot, even if things don't go as planned.

[contest:2013][problem:2013A]

Full text and comments »

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