結果
問題 | No.1747 Many Formulae 2 |
ユーザー |
👑 ![]() |
提出日時 | 2021-11-19 21:38:54 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 572 bytes |
コンパイル時間 | 251 ms |
コンパイル使用メモリ | 82,544 KB |
実行使用メモリ | 63,500 KB |
最終ジャッジ日時 | 2024-12-31 22:08:33 |
合計ジャッジ時間 | 1,821 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
""""""import sysfrom sys import stdindef is_prime(x):if x == 1:return Falsefor y in range(2,10**10):if y**2 > x:breakif x % y == 0:return Falsereturn TrueS = list(map(int, list(input()) ))N = len(S)ans = 0for i in range(2**(N-1)):s = 0now = S[0]for j in range(N-1):if 2**j & i > 0:now *= 10now += S[j+1]else:s += nownow = S[j+1]s += nowif is_prime(s):ans += 1print (ans)