One thing that might be worth trying is to fix these warnings and re-submit:
kay_vee-ALC002.cpp:9:22: warning: format specifies type 'int *' but the argument has type 'long *' [-Wformat]
scanf("%d%d",&n,&k);
~~ ^~
%ld
kay_vee-ALC002.cpp:9:25: warning: format specifies type 'int *' but the argument has type 'long *' [-Wformat]
scanf("%d%d",&n,&k);
~~ ^~
(the line numbers might differ for you - I’ve made some local changes to your source).
Yeah, it’s looking increasingly likely that the issue those warnings are complaining about is causing some nastiness - for example, changing the variable length arrays (shudder!) into vectors caused a crash if I didn’t fix those warnings, but worked fine when I did fix those warnings.
@ssjgz thanks alot for helping me out , it means a lot .
You were right by making those changes my code worked and codechef took my submission
Thanks a lot _/_
Actually it was a contest organized by PES University on 1st September from 21:00 to 2nd September 00:00 , i.e., 3 hours .
You had to pre-register for the contest and there were prizes for the winner .
There was nothing as such for a specific organization bro . Open to all . @aditya_81070