結果

問題 No.2188 整数列コイントスゲーム
ユーザー katonyonkokatonyonko
提出日時 2023-01-13 22:24:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 429 bytes
コンパイル時間 652 ms
コンパイル使用メモリ 86,640 KB
実行使用メモリ 76,776 KB
最終ジャッジ日時 2023-08-26 04:08:39
合計ジャッジ時間 5,944 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
76,516 KB
testcase_01 AC 75 ms
76,568 KB
testcase_02 AC 75 ms
76,720 KB
testcase_03 AC 79 ms
76,568 KB
testcase_04 AC 81 ms
76,636 KB
testcase_05 AC 62 ms
71,244 KB
testcase_06 AC 61 ms
71,216 KB
testcase_07 AC 73 ms
76,468 KB
testcase_08 AC 76 ms
76,592 KB
testcase_09 AC 81 ms
76,752 KB
testcase_10 AC 77 ms
76,404 KB
testcase_11 AC 78 ms
76,568 KB
testcase_12 AC 75 ms
76,728 KB
testcase_13 AC 77 ms
76,644 KB
testcase_14 AC 76 ms
76,596 KB
testcase_15 AC 60 ms
71,204 KB
testcase_16 AC 77 ms
76,564 KB
testcase_17 AC 78 ms
76,396 KB
testcase_18 AC 80 ms
76,532 KB
testcase_19 AC 77 ms
76,468 KB
testcase_20 AC 77 ms
76,472 KB
testcase_21 AC 77 ms
76,560 KB
testcase_22 AC 77 ms
76,568 KB
testcase_23 AC 77 ms
76,316 KB
testcase_24 AC 78 ms
76,512 KB
testcase_25 AC 79 ms
76,752 KB
testcase_26 AC 79 ms
76,468 KB
testcase_27 AC 79 ms
76,712 KB
testcase_28 AC 80 ms
76,568 KB
testcase_29 AC 78 ms
76,564 KB
testcase_30 AC 77 ms
76,624 KB
testcase_31 AC 76 ms
76,768 KB
testcase_32 AC 78 ms
76,768 KB
testcase_33 AC 76 ms
76,568 KB
testcase_34 AC 75 ms
76,592 KB
testcase_35 AC 77 ms
76,380 KB
testcase_36 AC 78 ms
76,552 KB
testcase_37 AC 76 ms
76,564 KB
testcase_38 AC 75 ms
76,408 KB
testcase_39 AC 74 ms
76,340 KB
testcase_40 AC 75 ms
76,776 KB
testcase_41 AC 82 ms
76,592 KB
testcase_42 AC 78 ms
76,508 KB
testcase_43 AC 75 ms
76,600 KB
testcase_44 AC 76 ms
76,608 KB
testcase_45 AC 79 ms
76,508 KB
testcase_46 AC 78 ms
76,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def input():
  return sys.stdin.readline()[:-1]
N=int(input())
M=int(input())
f=[1]
for i in range(30): f.append(f[-1]*(i+1))
if N==0:
  if M==0: print(1)
  else: print(0)
else:
  ans=[[]]
  for i in range(1,16):
    a=[0]
    for j in range(1,31):
      tmp=j**i
      for k in range(j):
        tmp-=a[k]*f[j]//f[k]//f[j-k]
      a.append(tmp)
    ans.append(a)
  if M>=len(ans[N]): print(0)
  else: print(ans[N][M])
0