結果

問題 No.1747 Many Formulae 2
ユーザー nok0nok0
提出日時 2021-11-10 23:42:48
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 1,374 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 77,380 KB
最終ジャッジ日時 2023-08-30 06:29:30
合計ジャッジ時間 3,155 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,544 KB
testcase_01 AC 70 ms
71,608 KB
testcase_02 AC 88 ms
77,064 KB
testcase_03 AC 71 ms
71,792 KB
testcase_04 AC 77 ms
75,932 KB
testcase_05 AC 69 ms
71,920 KB
testcase_06 AC 68 ms
71,704 KB
testcase_07 AC 82 ms
76,772 KB
testcase_08 AC 68 ms
71,888 KB
testcase_09 AC 69 ms
71,668 KB
testcase_10 AC 71 ms
71,896 KB
testcase_11 AC 72 ms
71,748 KB
testcase_12 AC 69 ms
71,760 KB
testcase_13 AC 68 ms
71,588 KB
testcase_14 AC 72 ms
71,736 KB
testcase_15 AC 88 ms
77,380 KB
testcase_16 AC 81 ms
76,820 KB
testcase_17 AC 70 ms
71,916 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_prime(x):
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0:
            return 0
    return 1


res = 0
s = input()
n = len(s)
for b in range(1 << (n - 1)):
    t = []
    for i in range(n):
        t.append(s[i])
        if i < n - 1 and b >> i & 1:
            t.append('+')
    res += is_prime(eval(''.join(t)))
print(res)
0