結果

問題 No.2188 整数列コイントスゲーム
ユーザー 👑 rin204rin204
提出日時 2023-01-13 22:01:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 366 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 78,376 KB
最終ジャッジ日時 2023-08-26 03:46:33
合計ジャッジ時間 7,315 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
78,000 KB
testcase_01 AC 100 ms
78,056 KB
testcase_02 AC 98 ms
78,376 KB
testcase_03 AC 95 ms
77,984 KB
testcase_04 AC 93 ms
78,324 KB
testcase_05 AC 61 ms
71,324 KB
testcase_06 AC 64 ms
71,436 KB
testcase_07 AC 95 ms
78,216 KB
testcase_08 AC 94 ms
78,232 KB
testcase_09 AC 95 ms
78,292 KB
testcase_10 AC 97 ms
78,152 KB
testcase_11 AC 98 ms
78,264 KB
testcase_12 AC 96 ms
78,212 KB
testcase_13 AC 94 ms
78,352 KB
testcase_14 AC 94 ms
77,184 KB
testcase_15 AC 63 ms
71,608 KB
testcase_16 AC 94 ms
78,220 KB
testcase_17 AC 93 ms
77,988 KB
testcase_18 AC 95 ms
78,212 KB
testcase_19 AC 90 ms
77,228 KB
testcase_20 AC 91 ms
77,152 KB
testcase_21 AC 90 ms
77,216 KB
testcase_22 AC 92 ms
77,220 KB
testcase_23 AC 91 ms
77,296 KB
testcase_24 AC 92 ms
77,224 KB
testcase_25 AC 94 ms
77,044 KB
testcase_26 AC 105 ms
77,264 KB
testcase_27 AC 95 ms
77,284 KB
testcase_28 AC 95 ms
77,220 KB
testcase_29 AC 95 ms
77,256 KB
testcase_30 AC 94 ms
76,960 KB
testcase_31 AC 97 ms
77,016 KB
testcase_32 AC 100 ms
77,856 KB
testcase_33 AC 100 ms
77,940 KB
testcase_34 AC 103 ms
77,600 KB
testcase_35 AC 101 ms
77,864 KB
testcase_36 AC 100 ms
77,800 KB
testcase_37 AC 98 ms
77,976 KB
testcase_38 AC 98 ms
77,740 KB
testcase_39 AC 102 ms
77,856 KB
testcase_40 AC 113 ms
77,936 KB
testcase_41 AC 108 ms
77,668 KB
testcase_42 AC 101 ms
77,868 KB
testcase_43 AC 103 ms
77,600 KB
testcase_44 AC 105 ms
77,884 KB
testcase_45 AC 107 ms
77,964 KB
testcase_46 AC 98 ms
77,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
m = int(input())
if n == 0:
    print(1 - min(1, m))
    exit()
A = [0]
P = [1]
for i in range(1, 300):
    P.append(P[-1])
    for j in range(i - 1, -1, -1):
        if j != 0:
            P[j] += P[j - 1]
    tot = sum(a * p for a, p in zip(A, P))
    A.append((pow(i, n) - tot) // P[-1])

if m >= len(A):
    print(0)
else:
    print(round(A[m]))
0