結果

問題 No.1747 Many Formulae 2
ユーザー ysys
提出日時 2022-03-09 02:22:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 77,148 KB
最終ジャッジ日時 2023-10-09 22:08:24
合計ジャッジ時間 2,871 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
71,484 KB
testcase_01 AC 62 ms
71,752 KB
testcase_02 AC 85 ms
77,020 KB
testcase_03 AC 64 ms
71,556 KB
testcase_04 AC 71 ms
76,000 KB
testcase_05 AC 64 ms
71,676 KB
testcase_06 AC 64 ms
71,560 KB
testcase_07 AC 72 ms
76,784 KB
testcase_08 AC 67 ms
71,672 KB
testcase_09 AC 67 ms
71,436 KB
testcase_10 AC 68 ms
71,664 KB
testcase_11 AC 66 ms
71,456 KB
testcase_12 AC 65 ms
71,668 KB
testcase_13 AC 65 ms
71,552 KB
testcase_14 AC 63 ms
71,640 KB
testcase_15 AC 85 ms
77,148 KB
testcase_16 AC 74 ms
76,788 KB
testcase_17 AC 66 ms
71,516 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

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