Hi,
I'm getting a WA for the code below, which basically finds out whether mechas have a strong monster than the strongest monster godzillas have. If yes, I break out of scanning further mecha input, and print MechaGodzilla. Else, Godzilla. This seems to be correct to me, but it's showing a WA on submit
Can someone please tell me why ?
Also, I found that if I don't break out of scanning input for Mechas if I find a stronger monster than the strongest Godzilla, I get AC. Then why the WA with the first one ? Some I/O buffering problem ?
Thanks ..
int main(){
int num = 0;
scanf("%d", &num);
while(num--){
int num_godzilla =0, num_mecha = 0;
scanf("\n%d %d\n", &num_godzilla, &num_mecha);
int max_g = 0, max_m = 0, cur = 0, i =0;
char s[3];
for(; i < num_godzilla; i++){
scanf("%d%[ \n]", &cur, s);
max_g = (cur > max_g ? cur : max_g);
}
for(i = 0; i < num_mecha; i++){
scanf("%d%[ \n]", &cur, s);
max_m = (cur > max_m ? cur : max_m);
if (max_m > max_g)
break;
}
printf("%s\n", (max_m > max_g) ? "MechaGodzilla" : "Godzilla");
}
exit(0);
}
Also, if