結果

問題 No.148 試験監督(3)
ユーザー fumiphysfumiphys
提出日時 2019-09-16 18:38:18
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 310 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 84,272 KB
最終ジャッジ日時 2023-09-21 08:00:54
合計ジャッジ時間 5,152 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
MOD = int(1e9) + 7
for i_ in range(t):
    c, p = list(map(int, input().split(" ")))
    if c < 2 * p - 1 or p >= MOD:
        print(0)
        continue
    res = 1
    for i in range(c - 2 * p + 2, c - p + 2):
        res = res * i % MOD
        if res == 0:
            break
    print(res)
0