結果

問題 No.801 エレベーター
ユーザー tempura_pptempura_pp
提出日時 2019-03-14 05:55:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 497 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 138,736 KB
最終ジャッジ日時 2023-09-07 12:29:23
合計ジャッジ時間 12,297 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 477 ms
89,996 KB
testcase_01 AC 477 ms
85,620 KB
testcase_02 AC 475 ms
85,524 KB
testcase_03 AC 636 ms
88,300 KB
testcase_04 AC 632 ms
88,344 KB
testcase_05 AC 637 ms
88,204 KB
testcase_06 AC 652 ms
88,408 KB
testcase_07 AC 631 ms
88,308 KB
testcase_08 AC 629 ms
88,472 KB
testcase_09 AC 627 ms
88,292 KB
testcase_10 AC 621 ms
88,264 KB
testcase_11 AC 615 ms
88,340 KB
testcase_12 AC 627 ms
88,444 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 #

n,m,k=map(int,input().split())
dp=[[0 for i in range(3030)]for j in range(3030)]
e=[]
for i in range(m) :
    x,y=map(int,input().split())
    e.append([x,y])
mod = 1000000007
dp[0][1]=1
for i in range(k):
    for j in range(n) :
        dp[i][j+1]+=dp[i][j]
        dp[i][j+1]%=mod
    for p in e :
        dp[i+1][p[0]]+=dp[i][p[1]]-dp[i][p[0]-1]
        dp[i+1][p[1]+1]-=dp[i][p[1]]-dp[i][p[0]-1]
    for j in range(n):
        dp[i+1][j+1]+=dp[i+1][j]
        dp[i+1][j+1]%=mod
print(dp[k][n])
0