結果

問題 No.308 素数は通れません
ユーザー uafr_csuafr_cs
提出日時 2015-12-02 23:13:07
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,819 bytes
コンパイル時間 2,072 ms
コンパイル使用メモリ 74,444 KB
実行使用メモリ 58,232 KB
最終ジャッジ日時 2023-10-12 09:09:34
合計ジャッジ時間 18,221 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,904 KB
testcase_01 AC 117 ms
55,884 KB
testcase_02 AC 118 ms
53,508 KB
testcase_03 AC 117 ms
55,592 KB
testcase_04 AC 120 ms
55,872 KB
testcase_05 AC 118 ms
55,328 KB
testcase_06 AC 120 ms
55,596 KB
testcase_07 AC 120 ms
55,804 KB
testcase_08 AC 118 ms
55,712 KB
testcase_09 WA -
testcase_10 AC 119 ms
55,860 KB
testcase_11 AC 120 ms
55,448 KB
testcase_12 AC 116 ms
55,692 KB
testcase_13 WA -
testcase_14 AC 123 ms
55,720 KB
testcase_15 AC 119 ms
55,860 KB
testcase_16 AC 122 ms
55,640 KB
testcase_17 AC 120 ms
55,592 KB
testcase_18 AC 119 ms
55,740 KB
testcase_19 AC 121 ms
55,856 KB
testcase_20 WA -
testcase_21 AC 120 ms
55,596 KB
testcase_22 AC 123 ms
55,860 KB
testcase_23 AC 118 ms
55,656 KB
testcase_24 AC 118 ms
55,424 KB
testcase_25 AC 118 ms
55,428 KB
testcase_26 AC 121 ms
55,396 KB
testcase_27 AC 120 ms
55,648 KB
testcase_28 AC 122 ms
55,728 KB
testcase_29 AC 121 ms
55,592 KB
testcase_30 AC 119 ms
55,940 KB
testcase_31 AC 117 ms
55,920 KB
testcase_32 AC 117 ms
55,764 KB
testcase_33 AC 123 ms
55,688 KB
testcase_34 AC 121 ms
55,436 KB
testcase_35 AC 119 ms
55,736 KB
testcase_36 AC 116 ms
55,724 KB
testcase_37 AC 120 ms
55,740 KB
testcase_38 AC 119 ms
55,836 KB
testcase_39 AC 119 ms
55,932 KB
testcase_40 AC 120 ms
55,388 KB
testcase_41 AC 120 ms
55,380 KB
testcase_42 AC 120 ms
55,980 KB
testcase_43 AC 119 ms
55,924 KB
testcase_44 AC 120 ms
55,756 KB
testcase_45 AC 118 ms
55,900 KB
testcase_46 AC 122 ms
55,756 KB
testcase_47 AC 121 ms
55,616 KB
testcase_48 AC 119 ms
55,720 KB
testcase_49 AC 122 ms
55,540 KB
testcase_50 AC 125 ms
56,136 KB
testcase_51 AC 122 ms
55,728 KB
testcase_52 AC 119 ms
55,592 KB
testcase_53 AC 122 ms
55,652 KB
testcase_54 AC 120 ms
55,748 KB
testcase_55 AC 120 ms
55,648 KB
testcase_56 WA -
testcase_57 AC 119 ms
55,556 KB
testcase_58 AC 124 ms
55,424 KB
testcase_59 AC 119 ms
55,476 KB
testcase_60 AC 119 ms
55,760 KB
testcase_61 AC 121 ms
55,976 KB
testcase_62 AC 119 ms
56,188 KB
testcase_63 WA -
testcase_64 AC 123 ms
55,772 KB
testcase_65 AC 123 ms
55,728 KB
testcase_66 AC 120 ms
55,392 KB
testcase_67 AC 117 ms
56,096 KB
testcase_68 AC 116 ms
55,992 KB
testcase_69 AC 115 ms
56,180 KB
testcase_70 AC 114 ms
56,364 KB
testcase_71 AC 116 ms
55,912 KB
testcase_72 AC 116 ms
56,144 KB
testcase_73 AC 119 ms
55,384 KB
testcase_74 AC 118 ms
55,924 KB
testcase_75 AC 116 ms
55,640 KB
testcase_76 AC 118 ms
56,092 KB
testcase_77 AC 115 ms
53,720 KB
testcase_78 AC 116 ms
55,900 KB
testcase_79 AC 119 ms
55,772 KB
testcase_80 AC 115 ms
55,932 KB
testcase_81 AC 117 ms
55,828 KB
testcase_82 AC 115 ms
55,664 KB
testcase_83 AC 115 ms
56,028 KB
testcase_84 AC 118 ms
56,116 KB
testcase_85 AC 118 ms
55,684 KB
testcase_86 AC 117 ms
55,384 KB
testcase_87 AC 115 ms
55,536 KB
testcase_88 AC 115 ms
55,712 KB
testcase_89 AC 118 ms
55,740 KB
testcase_90 AC 117 ms
55,760 KB
testcase_91 AC 118 ms
55,992 KB
testcase_92 AC 117 ms
55,644 KB
testcase_93 AC 118 ms
55,616 KB
testcase_94 AC 118 ms
55,932 KB
testcase_95 AC 120 ms
55,612 KB
testcase_96 WA -
testcase_97 AC 121 ms
55,752 KB
testcase_98 AC 118 ms
55,860 KB
testcase_99 WA -
testcase_100 WA -
testcase_101 AC 115 ms
55,792 KB
testcase_102 AC 123 ms
55,612 KB
testcase_103 AC 121 ms
55,728 KB
testcase_104 AC 120 ms
55,740 KB
testcase_105 AC 122 ms
55,856 KB
testcase_106 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		BigInteger N = new BigInteger(sc.next());
		
		final BigInteger four = BigInteger.valueOf(4);
		final BigInteger six = BigInteger.valueOf(6);
		final BigInteger eight = BigInteger.valueOf(8);
		final BigInteger nine = BigInteger.valueOf(9);
		final BigInteger ten = BigInteger.valueOf(10);
		final BigInteger twelve = BigInteger.valueOf(12);
		final BigInteger fourteen = BigInteger.valueOf(14);
		final BigInteger fifteen = BigInteger.valueOf(15);
		final BigInteger sixteen = BigInteger.valueOf(16);
		final BigInteger eighteen = BigInteger.valueOf(18);
		final BigInteger twenty = BigInteger.valueOf(20);
		final BigInteger twentyone = BigInteger.valueOf(21);
		final BigInteger twentytwo = BigInteger.valueOf(22);
		final BigInteger twentyfour = BigInteger.valueOf(24);
		final BigInteger twentyfive = BigInteger.valueOf(25);
		
		if(N.equals(four)){
			System.out.println(3);
		}else if(N.equals(six)){
			System.out.println(5);
		}else if(N.equals(eight) || N.equals(nine) || N.equals(ten) || N.equals(fifteen) || N.equals(sixteen) || N.equals(twentytwo)){
			System.out.println(7);
		}else if(N.equals(twelve)){
			System.out.println(11);
		}else if(N.equals(fourteen)){
			System.out.println(13);
		}else if(N.equals(eighteen)){
			System.out.println(17);
		}else if(N.equals(twenty) || N.equals(twentyone)){
			System.out.println(19);
		}else if(N.equals(twentyfive)){
			System.out.println(23);
		}else if(N.subtract(BigInteger.ONE).mod(eight).equals(BigInteger.ZERO)){
			System.out.println(14);
		}else{
			System.out.println(8);
		}
		
	}

}
0