QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#637276#3090. Inverse ProblemohwphilWA 15ms10640kbPython3365b2024-10-13 11:57:352024-10-13 11:57:35

Judging History

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

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

answer

N,M=map(int,input().split())
*nums,=map(int,input().split())
in_nums=[0]*(N+1)
for n in nums:
    in_nums[n]=1
curr_cnt=2
ans=1
MOD=119<<23|1
for i in range(M-1):
    if nums[i]>nums[i+1]:
        break
    curr_cnt+=1
if sum(in_nums[:nums[0]])!=nums[0]-1:
    print(0)
    exit(0)
for i in range(N-M):
    ans*=curr_cnt
    curr_cnt+=1
print(ans)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 7ms
memory: 10576kb

input:

7 2
2 1

output:

720

result:

ok single line: '720'

Test #2:

score: 0
Accepted
time: 15ms
memory: 10640kb

input:

8 5
2 3 4 5 8

output:

0

result:

ok single line: '0'

Test #3:

score: 0
Accepted
time: 15ms
memory: 10592kb

input:

498 121
20 35 40 72 79 92 113 117 154 231 243 244 264 268 304 337 362 378 463 477 56 494 495 1 342 395 183 423 291 475 82 422 96 265 83 283 242 34 187 75 74 47 208 380 400 17 202 50 418 73 233 307 181 344 48 149 107 435 365 459 280 55 375 391 403 241 64 374 10 386 322 308 186 136 277 497 332 262 165...

output:

0

result:

ok single line: '0'

Test #4:

score: -100
Wrong Answer
time: 15ms
memory: 10612kb

input:

499 396
2 3 6 8 11 13 14 15 16 19 22 23 24 32 36 37 40 41 44 51 53 56 57 58 61 62 66 68 74 75 76 79 80 85 86 87 89 90 91 92 96 98 101 102 109 110 111 113 114 115 117 119 122 123 127 129 130 135 140 141 145 149 150 160 163 166 167 171 173 176 177 183 185 195 197 200 204 207 210 216 217 229 230 235 23...

output:

4600189508632166725343688026582815634999314912781883397311322531751876683657200588373276810172941205947486518349080324978191365199062803089799584385402686158842789102806106002451949260444746190562684991862738696693350400000000000000000000000000

result:

wrong answer 1st lines differ - expected: '824443602', found: '460018950863216672534368802658...3350400000000000000000000000000'