QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#637248#3090. Inverse ProblemohwphilWA 15ms10464kbPython3460b2024-10-13 11:37:152024-10-13 11:37:15

Judging History

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

  • [2024-10-13 11:37:15]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:10464kb
  • [2024-10-13 11:37:15]
  • 提交

answer

N,M=map(int,input().split())
*nums,=map(int,input().split())
in_nums=[0]*(N+1)
intervals=[0]*(N+1)
for n in nums:
    in_nums[n]=1
intervals[nums[0]]+=1
intervals[nums[-1]]+=1
for i in range(M-1):
    intervals[max(nums[i],nums[i+1])]+=1
for i in range(N):
    intervals[i+1]+=intervals[i]
curr_cnt=0
ans=1
MOD=119<<23|1
for i in range(1,N+1):
    if not in_nums[i]:
        ans=ans*(intervals[i]+curr_cnt)%MOD
        curr_cnt+=1
print(ans)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 15ms
memory: 10464kb

input:

7 2
2 1

output:

2520

result:

wrong answer 1st lines differ - expected: '720', found: '2520'