Behaviour of two-dimensional array in C++

Правка en1, от mshcherba, 2016-08-31 13:51:17

Here are 2 solutions of the same problem: 20274603, 20298628. The only difference between them is two-dimensional array last. In first case it was last[MAXN][MAXQ], and in the second one — last[MAXQ][MAXN]. MAXN = 103 + 7, MAXQ = 105 + 7. I iterated only over that dimension, which has size MAXN. The first code is about 5 times slower. Could anyone please explain why? Thanks in advance.

Теги c++, arrays

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
ru1 Русский mshcherba 2016-08-31 13:57:50 466 Первая редакция перевода на Русский
en1 Английский mshcherba 2016-08-31 13:51:17 476 Initial revision (published)