結果

問題 No.1747 Many Formulae 2
ユーザー V_MelvilleV_Melville
提出日時 2021-11-20 02:29:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 355 bytes
コンパイル時間 826 ms
コンパイル使用メモリ 10,620 KB
実行使用メモリ 7,940 KB
最終ジャッジ日時 2023-08-30 16:03:08
合計ジャッジ時間 1,835 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,784 KB
testcase_01 AC 16 ms
7,784 KB
testcase_02 AC 25 ms
7,812 KB
testcase_03 AC 16 ms
7,780 KB
testcase_04 AC 18 ms
7,788 KB
testcase_05 AC 16 ms
7,808 KB
testcase_06 AC 16 ms
7,780 KB
testcase_07 AC 20 ms
7,928 KB
testcase_08 AC 16 ms
7,864 KB
testcase_09 AC 16 ms
7,784 KB
testcase_10 AC 17 ms
7,840 KB
testcase_11 AC 18 ms
7,924 KB
testcase_12 AC 16 ms
7,908 KB
testcase_13 AC 16 ms
7,816 KB
testcase_14 AC 16 ms
7,940 KB
testcase_15 AC 27 ms
7,812 KB
testcase_16 AC 21 ms
7,804 KB
testcase_17 AC 16 ms
7,780 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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


s = input()
n = len(s)
ans = 0
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('+')
    ans += is_Prime(eval(''.join(t)))
print(ans)
0