結果
| 問題 | No.1747 Many Formulae 2 |
| コンテスト | |
| ユーザー |
tamato
|
| 提出日時 | 2021-11-19 21:23:13 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 608 bytes |
| 記録 | |
| コンパイル時間 | 143 ms |
| コンパイル使用メモリ | 85,760 KB |
| 実行使用メモリ | 64,000 KB |
| 最終ジャッジ日時 | 2026-06-05 09:32:58 |
| 合計ジャッジ時間 | 4,091 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 TLE * 1 -- * 16 |
ソースコード
mod = 1000000007
eps = 10**-9
def main():
import sys
input = sys.stdin.readline
def is_prime(n):
res = 1
for i in range(2, n-1):
if n % i == 0:
res = 0
return res
S = input().rstrip('\n')
N = len(S)
ans = 0
for i in range(1 << (N - 1)):
st = []
for j in range(N-1):
st.append(S[j])
if i >> j & 1:
st.append("+")
st.append(S[-1])
a = eval("".join(st))
if is_prime(a):
ans += 1
print(ans)
if __name__ == '__main__':
main()
tamato