結果

問題 No.1747 Many Formulae 2
ユーザー roaris
提出日時 2021-11-19 21:57:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 3,217 ms
コンパイル使用メモリ 82,184 KB
実行使用メモリ 64,236 KB
最終ジャッジ日時 2025-01-01 17:19:21
合計ジャッジ時間 5,176 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from collections import *

s = list(input()[:-1])
n = len(s)
ans = 0

for S in range(1<<(n-1)):
    num = 0
    now = 0
    
    for i in range(n):
        now = 10*now+int(s[i])
        
        if (S>>i)&1:
            num += now
            now = 0
    
    num += now
    
    for i in range(2, num):
        if num%i==0:
            break
    else:
        ans += 1

print(ans)
0