結果

問題 No.801 エレベーター
ユーザー titiatitia
提出日時 2019-04-06 05:20:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 413 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,996 KB
実行使用メモリ 13,952 KB
最終ジャッジ日時 2023-09-05 12:36:07
合計ジャッジ時間 4,773 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,512 KB
testcase_01 AC 16 ms
8,256 KB
testcase_02 AC 16 ms
8,112 KB
testcase_03 AC 82 ms
8,416 KB
testcase_04 AC 81 ms
8,284 KB
testcase_05 AC 78 ms
8,392 KB
testcase_06 AC 82 ms
8,276 KB
testcase_07 AC 80 ms
8,256 KB
testcase_08 AC 84 ms
8,404 KB
testcase_09 AC 79 ms
8,336 KB
testcase_10 AC 80 ms
8,280 KB
testcase_11 AC 80 ms
8,232 KB
testcase_12 AC 83 ms
8,404 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
import sys
input = sys.stdin.readline

N,M,K=map(int,input().split())
LR=[list(map(int,input().split())) for i in range(M)]
mod=10**9+7

DP=[0]*(N+2)
DP[1]=1

for move in range(K):
    NDP=[0]*(N+2)
    SUM=list(itertools.accumulate(DP))


    for l,r in LR:
        x=SUM[r]-SUM[l-1]
        NDP[l]+=x%mod
        NDP[r+1]-=x%mod

    DP=list(itertools.accumulate(NDP))
        
print(DP[N]%mod)
0