結果

問題 No.148 試験監督(3)
ユーザー kmjp
提出日時 2015-02-08 23:58:42
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 402 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-06-23 08:18:10
合計ジャッジ時間 1,086 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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