Please read the new rule regarding the restriction on the use of AI tools. ×

aastik231205's blog

By aastik231205, history, 4 hours ago, In English

There seems to be quite bad limits set in problem A of the recent contest such that a brute force approach is passing using one set of operations but getting TLE using another set of operations both giving same Big O complexity. The two submissions are :-

Here is the submission getting TLE and here is the one getting Accepted.

Literally the only difference is that in one code there is an extra division in place of many multiplications in the TLE submission. Look I know integer division is slow but still either both of them should pass or both should fail.

Full text and comments »

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

By aastik231205, history, 2 months ago, In English

Hello guys, I just realised how much of a difference putting const in a global variable can make. I was doing CSES problem Coin combinations II. I was getting tle on the problem for quite a while. Just for trying i changed the global mod value's datatype from long long to const long long. My code which was giving tle on 1s got executed in 0.2s due to that 1 change.

Here's my Old submission and here's the New one.

Full text and comments »

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