Why am I always getting a WA on testcase 14

Правка en4, от yesbutno1685, 2020-08-11 23:54:05

Problem statement: https://codeforces.net/contest/924/problem/B

My submission (Using binary search approach): https://codeforces.net/contest/924/submission/89608314

My submission (Using two-pointers approach):https://codeforces.net/contest/924/submission/89602356

In this problem, I came up with two approaches which seem asynchronous to the editorial's solution. One using binary search and the other using the two pointers technique. However, both of my implementations WA-ed on testcase 14 with the same exact answer. I suspect that I am either doing something wrong with my logic and implementation or it is just some sort of annoying precision kind of error. (eg, rounding wrong, not precise enough, off by like 10^-8).

I would appreciate it if anyone would point out my error, or give me a hint. I spent a long time reading through the editorial many times, but still can't find my error.

Thank's in advance!

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский yesbutno1685 2020-08-11 23:54:05 7
en3 Английский yesbutno1685 2020-08-11 23:53:34 2 Tiny change: 'nt. I spend a long ti' -> 'nt. I spent a long ti'
en2 Английский yesbutno1685 2020-08-11 23:53:18 93
en1 Английский yesbutno1685 2020-08-11 23:51:34 1044 Initial revision (published)