The issue lies in the array size. The constraints specify that the array size can be up to 10^5, but you have defined a global array of size 100.
To resolve this, you can choose one of the following approaches:
Also do not use a array of size 10^5 for each test case since it might result in a TLE