結果

問題 No.148 試験監督(3)
ユーザー 👑 kmjpkmjp
提出日時 2015-02-08 23:58:42
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 6,532 KB
実行使用メモリ 6,504 KB
最終ジャッジ日時 2023-09-05 12:38:43
合計ジャッジ時間 1,376 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sys
import math



def comb(x,y):
	return 0

def hcomb(x,y):
	if x == 0:
		return y == 0
	return comb(x+y-1,y)


T=input()
mo=1000000007

for i in range(T):
	C,P=map(int,raw_input().strip().split(" "))
	if P*2-1>C:
		print 0
		continue
	elif P==1:
		print C%mo
		continue
	else:
		ret = 0
		ret += hcomb(C-(P+P-1),P-1)
		ret += hcomb(C-(P+P),P)*2
		ret += hcomb(C-(P+P+1),P+1)
		print ret % mo

0