sggts04's blog

By sggts04, history, 4 years ago, In English

Question Link: 1496C Submission Link: 109603686

The solution is under the constraints and the approach and method is same as most of the accepted solutions that I have seen. Why is my particular solution giving TLE?

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

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Storing long long instead of long double, and converting during sqrt() works, here, but why so? I've tried both long double and double they both are giving TLE, why?

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +7 Vote: I do not like it

    Reading long double is very slow. Special if use std::cin.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Okay, is it the same case with double? I tried double and it gave TLE aswell