結果

問題 No.2467 Sum of Product of Binomial Coefficients
ユーザー 👑 rin204rin204
提出日時 2023-09-06 23:36:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 433 ms / 2,000 ms
コード長 368 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 78,708 KB
最終ジャッジ日時 2023-09-12 00:41:46
合計ジャッジ時間 3,471 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
75,680 KB
testcase_01 AC 193 ms
75,692 KB
testcase_02 AC 212 ms
75,672 KB
testcase_03 AC 204 ms
75,692 KB
testcase_04 AC 220 ms
75,796 KB
testcase_05 AC 433 ms
78,524 KB
testcase_06 AC 198 ms
78,492 KB
testcase_07 AC 123 ms
78,456 KB
testcase_08 AC 195 ms
75,900 KB
testcase_09 AC 284 ms
78,708 KB
testcase_10 AC 106 ms
75,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353


def solve(n, k):
    ans = 0
    for i in range(1, k + 1):
        ans += pow(i + 1, n, MOD)
        ans %= MOD
    return ans


T = int(input())
assert 1 <= T <= 10**5
ktot = 0

for _ in range(T):
    n, k = map(int, input().split())
    assert 0 <= n <= 10**9
    assert 1 <= k <= 200000
    ktot += k
    print(solve(n, k))

assert ktot <= 200000
0