結果

問題 No.801 エレベーター
ユーザー pluto77pluto77
提出日時 2019-11-18 16:19:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 357 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 82,548 KB
実行使用メモリ 85,880 KB
最終ジャッジ日時 2024-04-09 20:00:58
合計ジャッジ時間 6,899 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
53,256 KB
testcase_01 AC 31 ms
53,156 KB
testcase_02 AC 34 ms
52,724 KB
testcase_03 AC 55 ms
76,252 KB
testcase_04 AC 53 ms
75,860 KB
testcase_05 AC 52 ms
76,192 KB
testcase_06 AC 54 ms
76,100 KB
testcase_07 AC 52 ms
76,300 KB
testcase_08 AC 51 ms
76,236 KB
testcase_09 AC 51 ms
76,120 KB
testcase_10 AC 51 ms
76,128 KB
testcase_11 AC 53 ms
76,144 KB
testcase_12 AC 52 ms
76,096 KB
testcase_13 AC 310 ms
85,764 KB
testcase_14 AC 309 ms
85,520 KB
testcase_15 AC 317 ms
85,400 KB
testcase_16 AC 318 ms
85,272 KB
testcase_17 AC 312 ms
85,356 KB
testcase_18 AC 311 ms
85,212 KB
testcase_19 AC 314 ms
85,544 KB
testcase_20 AC 314 ms
85,676 KB
testcase_21 AC 314 ms
85,880 KB
testcase_22 AC 311 ms
85,588 KB
testcase_23 AC 309 ms
85,348 KB
testcase_24 AC 317 ms
85,280 KB
testcase_25 AC 313 ms
85,152 KB
testcase_26 AC 315 ms
85,476 KB
testcase_27 AC 314 ms
85,488 KB
testcase_28 AC 274 ms
85,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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])
0