Some unexpected Behavior in CLBRKT

Using memset it gives TLE. CodeChef: Practical coding for everyone

In place of memset if loop is used then it is AC. CodeChef: Practical coding for everyone
Is this because of the fact that memset will always run from i=0 to 1=1e7 but in case of loop it runs till size of string only? This means there were more than 100 TC. Have you faced this before?

Also, can we declare an array of size 1e7 in main ?
CodeChef: Practical coding for everyone I have declared an array of size of string. I think max size of array can be 1e6 in main. But this was acceted.

@akshitm16 @everule1 @galencolin

Don’t know much about cpp, but this gives AC in 0.33 sec in C++ 17. Wait for others to answer.

Is this because of the fact that memset will always run from i=0 to 1=1e7 but in case of loop it runs till size of string only? This means there were more than 100 TC.

This maybe a reason 10^7 \cdot 10^3