Doubt regarding behaviour of C++17(64) and C++17.

Правка en1, от pritishn, 2020-08-03 22:19:39

One of my friends noticed a strange behaviour of .size() method.

Link to WA submission : https://codeforces.net/contest/1307/submission/88824759
Link to AC submission : https://codeforces.net/contest/1307/submission/88824749

The bug is in the line
LL x=a[i].size()*(a[i].size()-1)/2;

In C++17 , I guess there is overflow in that expression.
But in C++17(64) , it works fine.

So does that mean the .size() operator can hold larger numbers in 64bit version?
And also what other methods show this kind of varying behaviour when the compiler changes from 32bit to 64bit??
Can anyone explain this please??

Теги c++17, 32 bit vs 64 bit

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский pritishn 2020-08-03 22:19:39 700 Initial revision (published)