Allocation - Google Kickstart

having few doubts in code !!!

ques:- https://online.codingblocks.com/app/player/189104/content/180087/7601/lecture

code:- https://ide.codingblocks.com/s/476614

when I change the global variable to local (inside the main) the code doesn’t work it only take t as input and then terminate

and also case #2 output is wrong

and meaning of some of these lines below

define IOS ios::sync_with_studio(0);cin.tie(NULL); //here might get error

const int N = 1e5 + 5;

hello @dasvishal60

which global variable u r talking?
it should work for both the cases.

getting wrong answer becuase ur logic is wrong.
pls once re read the question , u have misunderstood the problem.

explain this line int N = 1e5 + 5;

1e5 means 10 raise to power 5.

so above line is nothing but int N=100005;

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.