QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#637248 | #3090. Inverse Problem | ohwphil | WA | 15ms | 10464kb | Python3 | 460b | 2024-10-13 11:37:15 | 2024-10-13 11:37:15 |
Judging History
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'