Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Блог пользователя SalooP

Автор SalooP, история, 7 лет назад, По-английски

Look at these submissions:

26586468

26586481

They have one different that is using:

for(int c:vec)

instead of:

for(int j=0;j<vec.size();j++){
    int c = vec[j];
    ...
}

one get Runtime and other one is Accepted.

I think that is happen because I change the size of my vector in the "for" However the size of it will be constant after each step.

Can I anyone explain? Tnks a lot.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +15
  • Проголосовать: не нравится