結果

問題 No.1106 🦉 何事もバランスが大事
ユーザー chocoruskchocorusk
提出日時 2020-07-04 00:36:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 11,928 KB
実行使用メモリ 10,836 KB
最終ジャッジ日時 2023-10-17 06:42:39
合計ジャッジ時間 5,126 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,192 KB
testcase_01 AC 28 ms
10,192 KB
testcase_02 AC 28 ms
10,192 KB
testcase_03 AC 28 ms
10,196 KB
testcase_04 AC 38 ms
10,760 KB
testcase_05 AC 29 ms
10,192 KB
testcase_06 AC 28 ms
10,192 KB
testcase_07 AC 29 ms
10,192 KB
testcase_08 AC 29 ms
10,192 KB
testcase_09 AC 28 ms
10,192 KB
testcase_10 AC 29 ms
10,196 KB
testcase_11 AC 29 ms
10,208 KB
testcase_12 AC 29 ms
10,220 KB
testcase_13 AC 30 ms
10,252 KB
testcase_14 AC 30 ms
10,272 KB
testcase_15 AC 31 ms
10,276 KB
testcase_16 AC 30 ms
10,276 KB
testcase_17 AC 30 ms
10,276 KB
testcase_18 AC 31 ms
10,276 KB
testcase_19 AC 30 ms
10,276 KB
testcase_20 AC 32 ms
10,364 KB
testcase_21 AC 33 ms
10,440 KB
testcase_22 AC 34 ms
10,468 KB
testcase_23 AC 36 ms
10,512 KB
testcase_24 AC 36 ms
10,536 KB
testcase_25 AC 38 ms
10,732 KB
testcase_26 AC 38 ms
10,768 KB
testcase_27 AC 39 ms
10,768 KB
testcase_28 AC 39 ms
10,768 KB
testcase_29 AC 39 ms
10,772 KB
testcase_30 AC 39 ms
10,792 KB
testcase_31 AC 40 ms
10,776 KB
testcase_32 AC 40 ms
10,796 KB
testcase_33 AC 40 ms
10,796 KB
testcase_34 AC 40 ms
10,796 KB
testcase_35 AC 40 ms
10,796 KB
testcase_36 AC 39 ms
10,796 KB
testcase_37 AC 39 ms
10,800 KB
testcase_38 AC 39 ms
10,800 KB
testcase_39 AC 39 ms
10,800 KB
testcase_40 AC 39 ms
10,800 KB
testcase_41 AC 40 ms
10,800 KB
testcase_42 AC 39 ms
10,800 KB
testcase_43 AC 38 ms
10,800 KB
testcase_44 AC 38 ms
10,800 KB
testcase_45 AC 39 ms
10,800 KB
testcase_46 AC 39 ms
10,800 KB
testcase_47 AC 39 ms
10,800 KB
testcase_48 AC 39 ms
10,800 KB
testcase_49 AC 39 ms
10,800 KB
testcase_50 AC 40 ms
10,800 KB
testcase_51 AC 35 ms
10,548 KB
testcase_52 AC 40 ms
10,812 KB
testcase_53 AC 39 ms
10,804 KB
testcase_54 AC 39 ms
10,804 KB
testcase_55 AC 40 ms
10,812 KB
testcase_56 AC 40 ms
10,812 KB
testcase_57 AC 40 ms
10,812 KB
testcase_58 AC 40 ms
10,812 KB
testcase_59 AC 40 ms
10,816 KB
testcase_60 AC 40 ms
10,816 KB
testcase_61 AC 40 ms
10,824 KB
testcase_62 AC 40 ms
10,820 KB
testcase_63 AC 39 ms
10,824 KB
testcase_64 AC 39 ms
10,824 KB
testcase_65 AC 36 ms
10,568 KB
testcase_66 AC 40 ms
10,836 KB
testcase_67 AC 40 ms
10,832 KB
testcase_68 AC 40 ms
10,836 KB
testcase_69 AC 39 ms
10,836 KB
testcase_70 AC 42 ms
10,836 KB
testcase_71 AC 42 ms
10,836 KB
testcase_72 AC 41 ms
10,836 KB
testcase_73 AC 41 ms
10,836 KB
testcase_74 AC 41 ms
10,836 KB
testcase_75 AC 40 ms
10,836 KB
testcase_76 AC 40 ms
10,796 KB
testcase_77 AC 40 ms
10,788 KB
testcase_78 AC 39 ms
10,768 KB
testcase_79 AC 38 ms
10,768 KB
testcase_80 AC 39 ms
10,768 KB
testcase_81 AC 38 ms
10,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

dp={}
def solve(l, r, d):
  if r<=1:
    if (d==0 or d==1) and l<=d and d<=r:
      return 1
    else:
      return 0
  if (l, r, d) in dp:
    return dp[l, r, d]
  ans=0
  for i in range(-2, 3):
    ans+=solve((l-i+4)//5, (r-i)//5, d-i)
  dp[l, r, d]=ans
  return ans
print(solve(1, int(input()), 0))
0