QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#373408#5547. Short FunctionohwphilWA 4ms9640kbPython3378b2024-04-01 16:26:012024-04-01 16:26:03

Judging History

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

  • [2024-04-01 16:26:03]
  • 评测
  • 测评结果:WA
  • 用时:4ms
  • 内存:9640kb
  • [2024-04-01 16:26:01]
  • 提交

answer

import sys
MOD=119<<23|1
#input=sys.stdin.readline
n,k=map(int,input().split())
*nums,=map(int,input().split())
cum_prod=[1]*(2*n+1)
for i in range(2*n):
    cum_prod[i+1]=(cum_prod[i]*nums[i%n])%MOD
cycle=(1<<k)//n
out=(1<<k)%n
ans=[pow(cum_prod[n],cycle,MOD)]*n
for i in range(n):
    ans[i]*=cum_prod[i+1+out]*pow(cum_prod[i],-1,MOD)
    ans[i]%=MOD
print(*ans)

详细

Test #1:

score: 0
Wrong Answer
time: 4ms
memory: 9640kb

input:

5 2
1 2 3 4 5

output:

120 120 120 120 120

result:

wrong answer 1st numbers differ - expected: '24', found: '120'