結果
問題 | No.1747 Many Formulae 2 |
ユーザー |
|
提出日時 | 2021-11-19 22:25:36 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 48 ms / 2,000 ms |
コード長 | 469 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 82,644 KB |
実行使用メモリ | 64,656 KB |
最終ジャッジ日時 | 2025-01-01 19:05:11 |
合計ジャッジ時間 | 2,000 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
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 if num==1: continue for i in range(2, int(num**0.5)+1): if num%i==0: break else: ans += 1 print(ans)