Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

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

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

I solved this question 1461D using a brute force method to find all valid sums in the array but one of my submission which seems correct to me doesnt seem to be working while another submission which is quite similar but just involves splitting and using it in a new vector gives a correct answer. Please help ?

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

»
6 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +7 Проголосовать: не нравится

Pass your vector by reference and that's all.

void rec(vt<int> a, int lo, int hi){

Correct one:

void rec(vt<int> &a, int lo, int hi){

I have resubmitted it here: 101179136