Almost Same Codes, One AC ,Other WA for PERCAPTA

Not sure what happened when you submitted.
I tried submitting the same code, with fast I/O here and it passes.

[EDIT]: Well well well, you have used "%d" to scan a long long datatype. Here is the accepted solution with scanf() using the proper type specifier, that is "%lld".

1 Like

oh

Sorry Bro I made a mistake of not putting ll.
My bad :confused:

1 Like

Lol. I shouldn’t have used long long for A and B. Int is sufficient. In that case I should typecaste all the comparisons to LL though.

It’s good practice to keep all the variables as int, if long long isn’t necessary. The operations on int are also faster.

1 Like

Yes,You are Right.I Sometimes got TLE due to unnecessary use of long long int where int was sufficient.Sometimes endl also landed me with TLE.

1 Like