結果

問題 No.1747 Many Formulae 2
ユーザー ys
提出日時 2022-03-09 02:22:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 66,096 KB
最終ジャッジ日時 2024-07-26 20:29:15
合計ジャッジ時間 2,046 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
N = len(S)
ans = 0
for i in range(1 << (N - 1)):
  res = 0
  tmp = S[0]
  for j in range(N - 1):
    if i & 1 << j:
      res += int(tmp)
      tmp = S[j + 1]
    else:
      tmp += S[j + 1]
  if tmp != '':
    res += int(tmp)
  for j in range(2, int(res ** 0.5) + 1):
    if res % j == 0:
      break
  else:
    ans += 1
print(ans)
0