結果

問題 No.1747 Many Formulae 2
ユーザー nok0nok0
提出日時 2021-11-11 00:04:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 87,312 KB
実行使用メモリ 76,948 KB
最終ジャッジ日時 2023-08-30 06:29:49
合計ジャッジ時間 2,732 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,476 KB
testcase_01 AC 68 ms
71,236 KB
testcase_02 AC 87 ms
76,720 KB
testcase_03 AC 71 ms
71,704 KB
testcase_04 AC 73 ms
75,848 KB
testcase_05 AC 69 ms
71,680 KB
testcase_06 AC 69 ms
71,700 KB
testcase_07 AC 81 ms
76,560 KB
testcase_08 AC 69 ms
71,776 KB
testcase_09 AC 69 ms
71,740 KB
testcase_10 AC 70 ms
71,252 KB
testcase_11 AC 72 ms
71,704 KB
testcase_12 AC 70 ms
71,684 KB
testcase_13 AC 70 ms
71,572 KB
testcase_14 AC 70 ms
71,376 KB
testcase_15 AC 88 ms
76,948 KB
testcase_16 AC 80 ms
76,748 KB
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_prime(x):
    if x == 2:
        return 0
    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