please help me whats the problem in this code

There’s an out-of-bounds access whenever K=N.

O shit this was tha first case i thought but i forgot to code thanks a lot man thank you thank you thank you so much God bless you

1 Like

Re: Solution: 54843964 | CodeChef - pay attention to compiler warnings!

[~/devel/hackerrank/otherpeoples]>  g++ -std=c++17 akashagarwal00-PROC18A.cpp -O3 -g3 -Wall -Wextra 
akashagarwal00-PROC18A.cpp: In function ‘int main()’:
akashagarwal00-PROC18A.cpp:16:24: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   16 |         int n,k,i,temp,ans;
      |                        ^~~

hey can you help me with this problem also
here is my solution which is getting wa

January 1st 2101 is a Saturday.