Python3求助,样例能过,评测全部WA
查看原帖
Python3求助,样例能过,评测全部WA
479378
Yungchit楼主2022/6/15 10:27
def factorial(x):
    if x==0:
        return 1
    else:
        return x*factorial(x-1)
        
T=eval(input())
ans=[]
for i in range(T):
    lst=list(input().split(' '))
    n=eval(lst[0])
    a=lst[1]
    time=0
    s=factorial(n)
    t=str(s)
    for j in t:
        if a==j:
            time+=1
    ans.append(time)
for i in ans:
    print(i)

怀疑是评测机的问题,洛谷上面经常出现本地IDE上能过但提交以后全部WA的情况

2022/6/15 10:27
加载中...