結果
問題 | No.308 素数は通れません |
ユーザー | shimomire |
提出日時 | 2015-12-01 01:19:35 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,714 bytes |
コンパイル時間 | 184 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 17,696 KB |
最終ジャッジ日時 | 2024-09-14 05:55:01 |
合計ジャッジ時間 | 7,246 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 30 ms
17,696 KB |
testcase_01 | AC | 30 ms
10,624 KB |
testcase_02 | AC | 30 ms
10,752 KB |
testcase_03 | AC | 32 ms
10,624 KB |
testcase_04 | AC | 30 ms
10,624 KB |
testcase_05 | AC | 30 ms
10,624 KB |
testcase_06 | AC | 30 ms
10,624 KB |
testcase_07 | AC | 30 ms
10,752 KB |
testcase_08 | AC | 30 ms
10,624 KB |
testcase_09 | WA | - |
testcase_10 | AC | 31 ms
10,496 KB |
testcase_11 | AC | 30 ms
10,496 KB |
testcase_12 | AC | 31 ms
10,624 KB |
testcase_13 | AC | 30 ms
10,624 KB |
testcase_14 | AC | 31 ms
10,752 KB |
testcase_15 | AC | 31 ms
10,624 KB |
testcase_16 | AC | 31 ms
10,624 KB |
testcase_17 | AC | 31 ms
10,624 KB |
testcase_18 | AC | 29 ms
10,880 KB |
testcase_19 | AC | 30 ms
10,624 KB |
testcase_20 | AC | 31 ms
10,624 KB |
testcase_21 | AC | 30 ms
10,624 KB |
testcase_22 | AC | 30 ms
10,624 KB |
testcase_23 | AC | 29 ms
10,624 KB |
testcase_24 | AC | 29 ms
10,624 KB |
testcase_25 | AC | 30 ms
10,624 KB |
testcase_26 | AC | 30 ms
10,624 KB |
testcase_27 | AC | 30 ms
10,624 KB |
testcase_28 | AC | 31 ms
10,624 KB |
testcase_29 | AC | 30 ms
10,752 KB |
testcase_30 | AC | 30 ms
10,752 KB |
testcase_31 | AC | 30 ms
10,624 KB |
testcase_32 | WA | - |
testcase_33 | AC | 29 ms
10,624 KB |
testcase_34 | AC | 30 ms
10,624 KB |
testcase_35 | AC | 30 ms
10,496 KB |
testcase_36 | AC | 30 ms
10,752 KB |
testcase_37 | AC | 31 ms
10,752 KB |
testcase_38 | AC | 30 ms
10,624 KB |
testcase_39 | AC | 30 ms
10,624 KB |
testcase_40 | AC | 30 ms
10,496 KB |
testcase_41 | AC | 31 ms
10,624 KB |
testcase_42 | AC | 31 ms
10,624 KB |
testcase_43 | AC | 30 ms
10,752 KB |
testcase_44 | AC | 30 ms
10,496 KB |
testcase_45 | AC | 30 ms
10,752 KB |
testcase_46 | AC | 30 ms
10,624 KB |
testcase_47 | AC | 30 ms
10,496 KB |
testcase_48 | AC | 31 ms
10,496 KB |
testcase_49 | AC | 30 ms
10,624 KB |
testcase_50 | AC | 30 ms
10,624 KB |
testcase_51 | AC | 29 ms
10,624 KB |
testcase_52 | AC | 30 ms
10,752 KB |
testcase_53 | AC | 30 ms
10,624 KB |
testcase_54 | AC | 30 ms
10,624 KB |
testcase_55 | AC | 31 ms
10,752 KB |
testcase_56 | AC | 30 ms
10,624 KB |
testcase_57 | AC | 30 ms
10,624 KB |
testcase_58 | AC | 30 ms
10,624 KB |
testcase_59 | AC | 30 ms
10,624 KB |
testcase_60 | AC | 31 ms
10,624 KB |
testcase_61 | AC | 29 ms
10,752 KB |
testcase_62 | AC | 31 ms
10,624 KB |
testcase_63 | AC | 30 ms
10,624 KB |
testcase_64 | AC | 31 ms
10,752 KB |
testcase_65 | AC | 30 ms
10,496 KB |
testcase_66 | AC | 30 ms
10,752 KB |
testcase_67 | AC | 30 ms
10,624 KB |
testcase_68 | AC | 30 ms
10,624 KB |
testcase_69 | AC | 30 ms
10,752 KB |
testcase_70 | AC | 30 ms
10,624 KB |
testcase_71 | AC | 30 ms
10,624 KB |
testcase_72 | AC | 30 ms
10,624 KB |
testcase_73 | AC | 31 ms
10,752 KB |
testcase_74 | AC | 31 ms
10,624 KB |
testcase_75 | AC | 30 ms
10,496 KB |
testcase_76 | WA | - |
testcase_77 | AC | 30 ms
10,624 KB |
testcase_78 | AC | 31 ms
10,624 KB |
testcase_79 | AC | 31 ms
10,624 KB |
testcase_80 | WA | - |
testcase_81 | WA | - |
testcase_82 | AC | 31 ms
10,624 KB |
testcase_83 | AC | 30 ms
10,752 KB |
testcase_84 | WA | - |
testcase_85 | AC | 30 ms
10,496 KB |
testcase_86 | TLE | - |
testcase_87 | -- | - |
testcase_88 | -- | - |
testcase_89 | -- | - |
testcase_90 | -- | - |
testcase_91 | -- | - |
testcase_92 | -- | - |
testcase_93 | -- | - |
testcase_94 | -- | - |
testcase_95 | -- | - |
testcase_96 | -- | - |
testcase_97 | -- | - |
testcase_98 | -- | - |
testcase_99 | -- | - |
testcase_100 | -- | - |
testcase_101 | -- | - |
testcase_102 | -- | - |
testcase_103 | -- | - |
testcase_104 | -- | - |
testcase_105 | -- | - |
testcase_106 | -- | - |
ソースコード
# 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 def is_prime(N): p = 2 while p*p <=N: if N%p == 0: return False p = p + 1 return True def run(N) : if N > 25 and not (N%8 == 1 and is_prime(N-8)): return 8 # 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 # N = 12,14,18,20,21,24 if N==12: return 11 if N == 14: return 13 if N == 18: return 17 if N== 20 or N == 21: return 19 if N==24 or N == 25: return 23 return N-1 #??? raise("err") N = int(input()) print(run(N))