Runtime Error..

Please Help me…
Getting Runtime Error(SIGSEGV).

Please Check my code and tell me the fault…
Code link given below with question.

Question Link:-

Code Link:-
http://www.codechef.com/viewsolution/5879832

  1. Define size of int m[P] inside loop after taking input for P.
  2. Remove all unnecessary cout.
  3. correct output format as add “<<endl”
    see this corrected code. CodeChef: Practical coding for everyone
1 Like