結果

問題 No.1747 Many Formulae 2
ユーザー suosuo
提出日時 2021-11-19 21:28:16
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 507 ms
コンパイル使用メモリ 87,168 KB
実行使用メモリ 77,428 KB
最終ジャッジ日時 2023-08-30 07:23:24
合計ジャッジ時間 3,022 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,868 KB
testcase_01 AC 73 ms
71,800 KB
testcase_02 AC 80 ms
77,056 KB
testcase_03 AC 69 ms
71,748 KB
testcase_04 AC 75 ms
76,360 KB
testcase_05 AC 71 ms
71,580 KB
testcase_06 AC 70 ms
71,564 KB
testcase_07 AC 80 ms
77,076 KB
testcase_08 AC 70 ms
71,732 KB
testcase_09 AC 70 ms
71,428 KB
testcase_10 AC 70 ms
71,604 KB
testcase_11 AC 73 ms
71,584 KB
testcase_12 AC 76 ms
71,968 KB
testcase_13 AC 70 ms
71,512 KB
testcase_14 AC 72 ms
71,640 KB
testcase_15 AC 86 ms
77,224 KB
testcase_16 AC 82 ms
77,428 KB
testcase_17 AC 72 ms
71,636 KB
testcase_18 AC 70 ms
71,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = str(input())
l = len(s)
p = []
for i in range(2**(l)//2):
  ad = format(i,'010b')[::-1][:l]
  now = 0
  par = 0
  for j in range(l-1):
    par *= 10
    par += int(s[j])
    if ad[j] == '1':
      now += par
      par = 0
  par *= 10
  par += int(s[-1])
  now += par
  p.append(now)
ans = 0
for i in p:
  if i == 1:
    continue
  for j in range(2,int(i**(1/2))+1):
    if i % j == 0:
      break
  else:
    ans += 1
print(ans)
0