結果

問題 No.1747 Many Formulae 2
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-11-19 22:35:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 82,124 KB
実行使用メモリ 64,152 KB
最終ジャッジ日時 2024-06-10 09:47:14
合計ジャッジ時間 1,702 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,616 KB
testcase_01 AC 42 ms
53,676 KB
testcase_02 AC 52 ms
61,696 KB
testcase_03 AC 37 ms
52,748 KB
testcase_04 AC 41 ms
58,592 KB
testcase_05 AC 37 ms
53,488 KB
testcase_06 AC 43 ms
53,196 KB
testcase_07 AC 46 ms
60,392 KB
testcase_08 AC 38 ms
52,612 KB
testcase_09 AC 38 ms
52,880 KB
testcase_10 AC 38 ms
52,524 KB
testcase_11 AC 37 ms
53,052 KB
testcase_12 AC 38 ms
52,452 KB
testcase_13 AC 37 ms
53,156 KB
testcase_14 AC 38 ms
53,896 KB
testcase_15 AC 56 ms
64,152 KB
testcase_16 AC 46 ms
62,044 KB
testcase_17 AC 37 ms
52,396 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

S = list(input())
for i in range(len(S)):
    S[i] = int(S[i])
ans = 0
for i in range(1<<len(S)-1):
    num = 0
    now = S[0]
    for j in range(len(S)-1):
        if i >> j & 1:
            num += now
            now = S[j+1]
        else:
            now *= 10
            now += S[j+1]
    num += now
    prime = 1
    for j in range(2,int(num**0.5)+1):
        if num%j == 0:
            prime = 0
            break
    ans += prime
print(ans)
0