結果

問題 No.1747 Many Formulae 2
ユーザー roarisroaris
提出日時 2021-11-19 21:57:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 420 bytes
コンパイル時間 829 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 77,644 KB
最終ジャッジ日時 2023-08-30 08:21:13
合計ジャッジ時間 6,771 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
71,608 KB
testcase_01 AC 94 ms
76,776 KB
testcase_02 AC 103 ms
77,548 KB
testcase_03 AC 89 ms
71,372 KB
testcase_04 AC 95 ms
76,684 KB
testcase_05 AC 86 ms
71,652 KB
testcase_06 AC 86 ms
71,496 KB
testcase_07 AC 132 ms
77,448 KB
testcase_08 AC 88 ms
71,688 KB
testcase_09 AC 88 ms
71,472 KB
testcase_10 AC 87 ms
71,616 KB
testcase_11 AC 87 ms
71,608 KB
testcase_12 AC 94 ms
76,684 KB
testcase_13 AC 89 ms
71,440 KB
testcase_14 AC 87 ms
71,256 KB
testcase_15 AC 1,888 ms
77,624 KB
testcase_16 AC 1,881 ms
77,644 KB
testcase_17 AC 87 ms
71,556 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

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