結果
問題 | No.801 エレベーター |
ユーザー |
|
提出日時 | 2019-11-18 16:19:01 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 399 ms / 2,000 ms |
コード長 | 357 bytes |
コンパイル時間 | 560 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 85,504 KB |
最終ジャッジ日時 | 2024-10-01 20:15:29 |
合計ジャッジ時間 | 8,493 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
#yuki801 import itertools mod=10**9+7 n,m,k=map(int,input().split()) lr=[] for i in range(m): lr.append(list(map(int,input().split()))) dp=[0]*(n+1) dp[1]=1 for i in range(k): t=[0]*(n+2) da=list(itertools.accumulate(dp)) for l,r in lr: t[l]+=da[r]-da[l-1] t[r+1]-=da[r]-da[l-1] dp=list(map(lambda x:x%mod,itertools.accumulate(t))) print(dp[-2])