Unexpected Runtime error in my solution for "Important exam".

Правка en1, от levi.ackerman1732, 2020-02-13 15:25:27

Hello all

1201A - Important Exam

My solution, was to store the number of responses(among A,B,C,D,E) for each question and choose the maximum among them and multiply with the marks awarded. I am getting a Runtime error. I am not able to figure out why.

The part of code where it's failing is:

s is string, j is the question number ~~~~~ temp = (int)(s[j]-'A'); v[j][temp]++; ~~~~~

I have encountered this problem quite a few times, but have avoided every time somehow. Please do let me know what is wrong with this.

My solution: 70953260

I am extremely sorry if I am asking something that is fairly obvious. Thank you for your time.

Теги #implementation, #strings, #brute force

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский levi.ackerman1732 2020-02-13 15:26:38 11
en1 Английский levi.ackerman1732 2020-02-13 15:25:27 731 Initial revision (published)