結果
問題 | No.1747 Many Formulae 2 |
ユーザー |
|
提出日時 | 2021-11-19 21:31:05 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 352 bytes |
コンパイル時間 | 214 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-31 21:27:48 |
合計ジャッジ時間 | 1,618 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
import itertoolsS = input()ans = 0for t in itertools.product((0, 1), repeat=(len(S) - 1)):N = S[0]for i, u in enumerate(t, 1):if u:N += "+"N += S[i]x = eval(N)for y in range(2, int(x ** .5) + 1):if not x % y:breakelse:if x != 1:ans += 1print(ans)