Enormous input Test Code question

Here is the link to the question asked:


This is my code for the solution:

typedef long long ll;

using namespace std;
int main()
ll n,k,t;
ll count=0;
scanf("%lld  %lld",&n,&k);

return 0;


Now I can’t seem to understand why this code is producing a WRONG ANSWER as the result. I checked some successful submissions. The AC codes I viewed are almost the same. Then why does this code produce an error?


the code you have typed above gets accepted just copy and paste it and it will be accepted with 5.55 sec runtime


on the other hand your previous submissions which are not accepted are having a problem that you have declared count as integer type and not ll

and then you are doing printf with ll type.

@v_akshary => if your analysis is right then code shouldn’t compile rather than giving wrong answer


Yes thank you it did solve my problem. But like the edit mentions: why is the code getting compiled in the first place instead of showing a wrong answer?