General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
132055180 Practice:
Pawabhi
1451A - 17 Java 8 Runtime error on test 1 109 ms 0 KB 2021-10-15 19:59:08 2021-10-15 19:59:08
→ Source
import java.util.*;
import java.util.ArrayList;
public class Main {
    public static void main(String args[]) {
        int  x=new Scanner(System.in).nextInt();
         while(x!=0){
            long s=new Scanner(System.in).nextLong();
             long p=0,d=0;
             while(s!=1)
             { d=0;
                 for(int i=2;i*i<=s;i++)
                 {
                     if(s%i==0)
                     {
                         s=i;
                         p++;
                         d=1;
                         break;
                     }
                 }
                 if(d==0)
                { s--;
                 p++;}
             }
            x--;
            System.out.println(p);
         }
    }
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details