Project Euler #108: Diophantine reciprocals I

  • + 0 comments
    int i,j,k,t;
        scanf("%d",&k);
        int num[k];
        if(k<=100&&k>=1)
        for(i=0;i<k;i++)
        {scanf("%d",&num[i]);}
        for(i=0;i<k;i++){j=0;
         if(num[i]>(int)pow(10,18)&&num[i]<2){continue;}
        for(t=1;t<=num[i];t++){
          if(((int)pow(num[i],2))%t==0){
            j+=1;
          }else{continue;}
        }printf("%d\n",j);
        }
    

    I am able to pass only four test cases(0,1,2,3) for (4,5,6) testcases it saya wrong answer and for the rest it says timeout. what's the mistake i have done.please correct me.