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:
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:
The size of your array equals N, But shouldn’t it be equal to K.
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
I feel sad for you…xD
Haha… Did I?
Lololololololol xDDDDD
No one can answer before you if you never answer
No one can answer before you if you're the only guy in the forum
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;
}