QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#708689 | #5681. Caravan Trip Plans | mgoldy925# | WA | 12ms | 10780kb | Python3 | 606b | 2024-11-04 03:31:45 | 2024-11-04 03:31:45 |
Judging History
answer
import sys
import math
input = sys.stdin.readline
ints = lambda : map(int, input().split())
intsl = lambda : list(ints())
def main():
n, m = ints()
os = intsl()
ans = []
def choose(n,k):
return int(math.factorial(n) / math.factorial(k) / math.factorial(n-k))
for _ in range(m):
dm, tm = ints()
days = tm - os[dm-1]
oases = dm + 1
print(days+oases-1, days)
ans.append(0 if days < 0 else choose(days+oases-1, days))
print("\n".join(map(str, ans)))
if __name__ == "__main__":
main()
详细
Test #1:
score: 0
Wrong Answer
time: 12ms
memory: 10780kb
input:
5 1 2 3 5 7 11 3 7
output:
5 2 10
result:
wrong answer 1st lines differ - expected: '10', found: '5 2'