結果

問題 No.308 素数は通れません
ユーザー shimomireshimomire
提出日時 2015-12-01 01:32:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,663 bytes
コンパイル時間 232 ms
コンパイル使用メモリ 10,776 KB
実行使用メモリ 7,980 KB
最終ジャッジ日時 2023-10-12 06:48:30
合計ジャッジ時間 5,264 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,812 KB
testcase_01 AC 16 ms
7,856 KB
testcase_02 AC 15 ms
7,820 KB
testcase_03 AC 16 ms
7,908 KB
testcase_04 AC 16 ms
7,792 KB
testcase_05 AC 16 ms
7,980 KB
testcase_06 AC 16 ms
7,772 KB
testcase_07 AC 16 ms
7,820 KB
testcase_08 AC 16 ms
7,772 KB
testcase_09 AC 16 ms
7,796 KB
testcase_10 AC 16 ms
7,776 KB
testcase_11 AC 16 ms
7,892 KB
testcase_12 AC 16 ms
7,976 KB
testcase_13 AC 16 ms
7,776 KB
testcase_14 AC 16 ms
7,796 KB
testcase_15 AC 16 ms
7,912 KB
testcase_16 AC 16 ms
7,784 KB
testcase_17 AC 16 ms
7,792 KB
testcase_18 AC 16 ms
7,920 KB
testcase_19 AC 16 ms
7,816 KB
testcase_20 WA -
testcase_21 AC 16 ms
7,816 KB
testcase_22 AC 16 ms
7,856 KB
testcase_23 AC 16 ms
7,792 KB
testcase_24 AC 16 ms
7,816 KB
testcase_25 AC 17 ms
7,808 KB
testcase_26 AC 16 ms
7,872 KB
testcase_27 AC 16 ms
7,848 KB
testcase_28 AC 16 ms
7,788 KB
testcase_29 AC 16 ms
7,776 KB
testcase_30 AC 16 ms
7,820 KB
testcase_31 AC 16 ms
7,804 KB
testcase_32 WA -
testcase_33 AC 16 ms
7,912 KB
testcase_34 AC 16 ms
7,820 KB
testcase_35 AC 16 ms
7,792 KB
testcase_36 AC 16 ms
7,824 KB
testcase_37 AC 16 ms
7,908 KB
testcase_38 AC 16 ms
7,776 KB
testcase_39 AC 16 ms
7,844 KB
testcase_40 AC 16 ms
7,812 KB
testcase_41 AC 16 ms
7,924 KB
testcase_42 AC 16 ms
7,872 KB
testcase_43 AC 16 ms
7,824 KB
testcase_44 AC 16 ms
7,744 KB
testcase_45 AC 16 ms
7,856 KB
testcase_46 AC 16 ms
7,788 KB
testcase_47 AC 16 ms
7,808 KB
testcase_48 AC 16 ms
7,908 KB
testcase_49 AC 16 ms
7,772 KB
testcase_50 AC 16 ms
7,816 KB
testcase_51 AC 16 ms
7,932 KB
testcase_52 AC 16 ms
7,884 KB
testcase_53 AC 16 ms
7,888 KB
testcase_54 AC 16 ms
7,912 KB
testcase_55 AC 15 ms
7,920 KB
testcase_56 WA -
testcase_57 AC 15 ms
7,772 KB
testcase_58 AC 16 ms
7,856 KB
testcase_59 AC 15 ms
7,888 KB
testcase_60 AC 16 ms
7,860 KB
testcase_61 AC 16 ms
7,812 KB
testcase_62 AC 15 ms
7,824 KB
testcase_63 WA -
testcase_64 AC 16 ms
7,772 KB
testcase_65 AC 16 ms
7,924 KB
testcase_66 AC 15 ms
7,816 KB
testcase_67 AC 16 ms
7,788 KB
testcase_68 AC 15 ms
7,860 KB
testcase_69 AC 16 ms
7,744 KB
testcase_70 AC 16 ms
7,744 KB
testcase_71 AC 16 ms
7,804 KB
testcase_72 AC 16 ms
7,856 KB
testcase_73 AC 16 ms
7,976 KB
testcase_74 AC 16 ms
7,824 KB
testcase_75 AC 16 ms
7,836 KB
testcase_76 AC 16 ms
7,792 KB
testcase_77 AC 16 ms
7,776 KB
testcase_78 AC 16 ms
7,776 KB
testcase_79 AC 16 ms
7,936 KB
testcase_80 AC 15 ms
7,972 KB
testcase_81 AC 15 ms
7,788 KB
testcase_82 AC 16 ms
7,788 KB
testcase_83 AC 16 ms
7,776 KB
testcase_84 AC 16 ms
7,888 KB
testcase_85 AC 16 ms
7,812 KB
testcase_86 AC 16 ms
7,852 KB
testcase_87 AC 16 ms
7,796 KB
testcase_88 AC 16 ms
7,820 KB
testcase_89 AC 17 ms
7,860 KB
testcase_90 AC 16 ms
7,796 KB
testcase_91 AC 15 ms
7,980 KB
testcase_92 AC 16 ms
7,904 KB
testcase_93 AC 16 ms
7,848 KB
testcase_94 AC 16 ms
7,972 KB
testcase_95 AC 16 ms
7,800 KB
testcase_96 WA -
testcase_97 AC 16 ms
7,904 KB
testcase_98 AC 16 ms
7,912 KB
testcase_99 WA -
testcase_100 WA -
testcase_101 AC 16 ms
7,744 KB
testcase_102 AC 16 ms
7,800 KB
testcase_103 AC 15 ms
7,812 KB
testcase_104 AC 16 ms
7,812 KB
testcase_105 AC 16 ms
7,916 KB
testcase_106 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# W = 2
#   1  x2
#  x3

# W = 3
#   1  x2  x3
#   4  x5
#  x7

# W = 4
#   1  x2
#  x5

# W = 5
#   1  x2
#   6  x7
# x11

# W = 6
#   1  x2
#  x7

# W = 7
#   1  x2  x3
#   8   9  10 x11
#  15  16 x17
#  22 x23
# x29 

# W = 8
#   1  x2  x3   4  x5   6  x7   8
#   9  10 x11  12 x13  14  15  16
# x17  18 x19  20  21  22 x23  24
# !25  26  27  28 x29  30 x31  32
# x33  34  35  36 x37  38 x39  40
# x41  42 x43  44  45  46 x47  48
# !49  ..........................

# W = 9
#   1  x2  x3
#  10 x11
# x19

# W = 11
#   1  x2
#  12 x13
# x23

# W = 13
#   1  x2  x3
#  14  15  16 x17
#  27  28 x29
#  40 x41
# x53

# W = 14
#   1  x2  x3   4  x5   6  x7   8   9  10 x11  12 x13  14
#  15  16 x17  18 x19  20  21  22 x23  24  25  26  27  28
# x29  30 x31  32 x33  34  35  36 x37  38 x39  40 x41  42
# x43  44  45  46 x47  48  49  50  51  52 x53  54  55  56
#  57  58 x59  60 x61  62  63  64  65  66 x67  68  69  70
# x71  72 x73  74  75  76  77  78 x79  80  81  82 x83  84

# W = 15
#   1  x2  x3
#  16 x17
# x31

# W = 17


def run(N) :
    if N > 25:
        if N%8 != 1:
            return 8

        if N == 33:
            return 32
        if N == 49:
            return 47
        return 14
    # N = 4,6,8,9,10,12,14,15,16,18,20,21,22,24,25
    if N == 4 :
        return 3
    if N == 6:
        return 5
    if N==8 or N == 9 or N == 10 or N == 15 or N == 16 or N == 22:
        return 7
    if N == 18:
        return 8
    # N = 12,14,20,21,24
    if N==12:
        return 11
    if N == 14:
        return 13
    if N== 20 or N == 21:
        return 19
    if N==24 or N == 25:
        return 23

    
    raise("err") 

N = int(input())
print(run(N))
0