結果

問題 No.1747 Many Formulae 2
ユーザー H3PO4
提出日時 2021-11-19 21:29:08
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-31 21:18:30
合計ジャッジ時間 1,751 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools

S = input()

ans = 0
for t in itertools.product((0, 1), repeat=(len(S) - 1)):
    N = S[0]
    for i, u in enumerate(t, 1):
        if u:
            N += "+"
        N += S[i]
    x = eval(N)
    for y in range(2, int(x ** .5) + 1):
        if not x % y:
            break
    else:
        ans += 1
print(ans)
0