https://vjudge.net/contest/218366
Java解
1 import java.math.BigInteger; 2 import java.util.Scanner; 3 4 public class Main { 5 public static void main(String[] args) { 6 Scanner cin = new Scanner(System.in); 7 BigInteger a = cin.nextBigInteger(); 8 Boolean b = a.isProbablePrime(1); 9 if(b == true) 10 System.out.println("Yes"); 11 else 12 System.out.println("No"); 13 cin.close(); 14 } 15 }