NothingOccurred's blog

By NothingOccurred, 11 months ago, In English

In problem 1163F, I used a cumbersome code implementation to solve this problem.

And I met some mysterious problem about efficiency of the code,here is the problem.

I got TLE when I submit this code.

Submission(c++20,64bits).

At first I think is there anywhere I forgot to use long long(because it may cause some while conditions error). So I use #define int long long at the front of the code.

Then it got accepted? After that I checked every variables and arrays is sure to be in int.

Submission 2(define int long long,c++20,64bits)

So I remove #define int long long and resubmitted it in language c++17 (32bits) and got accepted.

Submission 3(c++17,32bits)

Why #define int long long can cause a 2.5x efficiency difference? I'm very confused about it.


There may be some English grammar errors but they may not affect the reading. Please point them out.qwq

Full text and comments »

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