結果
問題 | No.801 エレベーター |
ユーザー | Ueki |
提出日時 | 2019-03-17 22:19:41 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 611 bytes |
コンパイル時間 | 399 ms |
コンパイル使用メモリ | 10,732 KB |
実行使用メモリ | 250,060 KB |
最終ジャッジ日時 | 2023-09-22 07:28:16 |
合計ジャッジ時間 | 5,351 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 16 ms
12,232 KB |
testcase_01 | AC | 15 ms
7,764 KB |
testcase_02 | AC | 15 ms
7,932 KB |
testcase_03 | AC | 73 ms
12,836 KB |
testcase_04 | AC | 74 ms
12,776 KB |
testcase_05 | AC | 73 ms
12,800 KB |
testcase_06 | AC | 74 ms
12,976 KB |
testcase_07 | AC | 75 ms
13,036 KB |
testcase_08 | AC | 77 ms
13,076 KB |
testcase_09 | AC | 73 ms
12,832 KB |
testcase_10 | AC | 75 ms
12,724 KB |
testcase_11 | AC | 74 ms
12,676 KB |
testcase_12 | AC | 75 ms
12,976 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 | -- | - |
ソースコード
# python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline N, M, K = map(int, input().split()) elev = [list(map(int, input().split())) for _ in range(M)] dp = [[0]*(N+2) for _ in range(K+1)] dp[0][1] = 1 MOD = 10**9+7 def solve3(): for k in range(K): for i in range(N+1): dp[k][i+1] += dp[k][i] for l, r in elev: su = dp[k][r]-dp[k][l-1] dp[k+1][l] += su dp[k+1][r+1] -= su for i in range(N+1): dp[k+1][i+1] += dp[k+1][i] dp[k+1][i] %= MOD solve3() print(dp[K][N])