結果

問題 No.801 エレベーター
ユーザー ayaoniayaoni
提出日時 2020-11-24 17:51:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 524 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 13,364 KB
最終ジャッジ日時 2023-10-01 01:07:39
合計ジャッジ時間 5,194 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
12,332 KB
testcase_01 AC 17 ms
7,756 KB
testcase_02 AC 17 ms
7,900 KB
testcase_03 AC 123 ms
7,816 KB
testcase_04 AC 127 ms
7,876 KB
testcase_05 AC 125 ms
7,836 KB
testcase_06 AC 118 ms
7,752 KB
testcase_07 AC 126 ms
7,908 KB
testcase_08 AC 127 ms
7,792 KB
testcase_09 AC 118 ms
7,828 KB
testcase_10 AC 120 ms
7,864 KB
testcase_11 AC 117 ms
7,812 KB
testcase_12 AC 123 ms
7,808 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 sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())


N,M,K = MI()
LR = [tuple(MI()) for _ in range(M)]
mod = 10**9+7

A = [0]*(N+2)
SA = [1]*(N+2)
SA[0] = 0
for _ in range(K):
    for i in range(M):
        L,R = LR[i]
        x = SA[R]-SA[L-1]
        A[L] += x
        A[R+1] -= x
    SA = [0]*(N+2)
    for i in range(1,N+2):
        SA[i] = A[i]+SA[i-1]
        SA[i] %= mod
    for i in range(1,N+2):
        SA[i] += SA[i-1]
        SA[i] %= mod
    A = [0]*(N+2)

print((SA[N]-SA[N-1]) % mod)
0