C++ std::min function does not seem to return correctly when using it on two std:array objects

Правка en2, от idk321, 2021-01-10 18:36:19

Take a look at the end of these two programs:

https://atcoder.jp/contests/abc188/submissions/19361247

https://atcoder.jp/contests/abc188/submissions/19361394

One is correct and the other is not, even though in theory the one with std::min should be equivalent, since the first values of the arrays are all pairwise distinct.

EDIT: std::array variable holding fundamental types of local scope is not zero initialized (unlike other containers to my knowledge).

Теги #c++, #min, #array

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский idk321 2021-01-10 18:36:19 137
en1 Английский idk321 2021-01-10 18:15:44 427 Initial revision (published)