結果

問題 No.1747 Many Formulae 2
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-11-19 22:35:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 76,960 KB
最終ジャッジ日時 2023-08-30 09:22:12
合計ジャッジ時間 3,005 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,680 KB
testcase_01 AC 79 ms
71,576 KB
testcase_02 AC 84 ms
76,940 KB
testcase_03 AC 76 ms
71,964 KB
testcase_04 AC 83 ms
76,036 KB
testcase_05 AC 77 ms
71,796 KB
testcase_06 AC 75 ms
71,452 KB
testcase_07 AC 84 ms
76,568 KB
testcase_08 AC 75 ms
71,596 KB
testcase_09 AC 73 ms
71,936 KB
testcase_10 AC 74 ms
71,700 KB
testcase_11 AC 76 ms
71,552 KB
testcase_12 AC 75 ms
71,396 KB
testcase_13 AC 76 ms
71,552 KB
testcase_14 AC 75 ms
71,444 KB
testcase_15 AC 87 ms
76,960 KB
testcase_16 AC 85 ms
76,516 KB
testcase_17 AC 74 ms
71,496 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