DOUBT BASED ON QUESTION "NUKES"

Hey, I submitted my code for the NUKES problem, but 4 of the 8 cases got rejected. Could someone please help me out? Thanks.

My code:

https://www.codechef.com/viewsolution/18896716

The size of your array equals N, But shouldn’t it be equal to K.

1 Like

:confused: Do you know how many times I had to submit the code to find out the bug?? Just when I was about to write, I came to know that the question is answered…

Man, why don’t you all just sleep? XD

1 Like

I feel sad for you…xD

1 Like

It’s karma @sarthakmanna… U did the same thing to me sometimes… xD

1 Like

Haha… Did I?

1 Like

Lololololololol xDDDDD

No one can answer before you if you never answer :stuck_out_tongue: :stuck_out_tongue:

No one can answer before you if you're the only guy in the forum
1 Like

lololol
Yeah sure

Hahahha xD

@vijju123 Sir i need ur help again tried to remove error many times but code is not satisfying one test case and is exceeding time limit and that while(a-) is a-- when i copy it becomes like that please help
#include <stdio.h>

int main(void) {
// your code goes here
long long int a;
scanf("%lld",&a);
int n,k;
scanf("%d%d",&n,&k);
int chamber[k];
for(int i=0;i<k;i++){
chamber[i]=0;
}
while(a–){
int i=0;
chamber[i]++;
if(chamber[i]>n){
sos:
chamber[i]=0;
i++;
chamber[i]+=1;
if(chamber[i]>n) goto sos;
}

}
for(int i=0;i<k;i++){
     printf("%d ",chamber[i]);
 } 
return 0;

}