QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#708689#5681. Caravan Trip Plansmgoldy925#WA 12ms10780kbPython3606b2024-11-04 03:31:452024-11-04 03:31:45

Judging History

你现在查看的是最新测评结果

  • [2024-11-04 03:31:45]
  • 评测
  • 测评结果:WA
  • 用时:12ms
  • 内存:10780kb
  • [2024-11-04 03:31:45]
  • 提交

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()

Details

Tip: Click on the bar to expand more detailed information

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'