結果
問題 |
No.1747 Many Formulae 2
|
ユーザー |
![]() |
提出日時 | 2021-11-19 21:37:50 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 530 bytes |
コンパイル時間 | 345 ms |
コンパイル使用メモリ | 82,100 KB |
実行使用メモリ | 62,540 KB |
最終ジャッジ日時 | 2024-12-31 22:04:55 |
合計ジャッジ時間 | 1,975 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 1 |
ソースコード
""" """ import sys from sys import stdin def is_prime(x): for y in range(2,10**10): if y**2 > x: break if x % y == 0: return False return True S = list(map(int, list(input()) )) N = len(S) ans = 0 for i in range(2**(N-1)): s = 0 now = S[0] for j in range(N-1): if 2**j & i > 0: now *= 10 now += S[j+1] else: s += now now = S[j+1] s += now if is_prime(s): ans += 1 print (ans)