結果
| 問題 |
No.389 ロジックパズルの組み合わせ
|
| コンテスト | |
| ユーザー |
sasa8uyauya
|
| 提出日時 | 2024-09-29 22:44:10 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 710 ms / 2,000 ms |
| コード長 | 301 bytes |
| コンパイル時間 | 404 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 266,000 KB |
| 最終ジャッジ日時 | 2024-09-29 22:44:50 |
| 合計ジャッジ時間 | 26,126 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 99 |
ソースコード
n=int(input()) M=10**9+7 fa=[1,1] fb=[1,1] for i in range(2,n*2+1): fa+=[fa[-1]*i%M] fb+=[fb[-1]*(M//i)*fb[M%i]*fa[M%i-1]*(-1)%M] c=lambda n,k:fa[n]*fb[k]*fb[n-k]%M if n>=k>=0 else "NA" h=list(map(int,input().split())) if h==[0]: print(1) exit() k=len(h) print(c(n-sum(h)-(k-1)+k+1-1,k+1-1))
sasa8uyauya