help me out this
there is my code : ALICE AND TOTIENT
#include<iostream>
#include<cstring>
#include<vector>
#define N 1000002
using namespace std;
long arr[N];
void sieves(){
// arr.reserve(N);
memset(arr,0,sizeof(arr));
for(long i=2 ; i<N ; i += 2){
arr[i]=2;
}
for(long i = 3 ; i < N ; i += 2){
if(arr[i] == 0){
arr[i] = i;
for(long j = i*i ; j < N ; j += 2*i)
arr[j] = i;
}
}
}
int main(){
long t,temp;
long long totient;
sieves();
// for(int i=0;i<100;i++)
// cout<<arr[i]<<" ";
// cout<<'\n';
cin>>t;
while(t--){
cin>>temp;
totient = temp;
vector <int> v;
v.reserve(100);
int i = 0;
while (temp != 1){
v.push_back(arr[temp]);
totient /= arr[temp];
temp /= arr[temp];
while(v[i] == arr[temp]){
temp /= arr[temp];
}
i++;
}
for(long i:v){
totient *= (i-1);
}
cout<<totient<<endl;
}
return 0;
}