-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMichaelCryptography.java
More file actions
39 lines (28 loc) · 862 Bytes
/
Copy pathMichaelCryptography.java
File metadata and controls
39 lines (28 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.util.*;
import java.io.*;
public class MichaelCryptography {
public static void main(String[] args) {
Scanner in = new Scanner(System.in).useLocale(Locale.US);
PrintWriter out = new PrintWriter(System.out);
long n = in.nextLong();
int result = 0;
for (long i = 2; i*i <= n && result < 22; i++) {
// System.out.println("i="+i);
//i = 1000000007 n=1000000007
while (n % i == 0) {
//System.out.println("New div: "+i + " n="+n);
result++;
n /= i;
}
}
if (n > 1) {
result++;
}
if (result == 20) {
System.out.println("Yes");
}
else {
System.out.println("No");
}
}
}