ghoshsai5000's blog

By ghoshsai5000, history, 7 years ago, In English

I am getting a runtime error for this program here. I have tried for many days but have been unable to detect the cause of the error. Please help me.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
7 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Just, start learn C++ )). Write on pure C — for competitive programming is bad idea.

unsigned long long*no_of_meals = 
(unsigned long long*)malloc((maximum_length + 1)*sizeof(unsigned long ));
//                                                    |-----------------> see, use unsigned long long.

unsigned long long*sum_no_of_meals =  
(unsigned long long*)malloc((maximum_length + 1)*sizeof(unsigned long));
//                                                   |--------------> see, use unsigned long long.