結果
問題 | No.801 エレベーター |
ユーザー |
![]() |
提出日時 | 2021-02-12 14:44:22 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 255 ms / 2,000 ms |
コード長 | 1,107 bytes |
コンパイル時間 | 130 ms |
コンパイル使用メモリ | 82,024 KB |
実行使用メモリ | 77,056 KB |
最終ジャッジ日時 | 2024-07-19 08:04:05 |
合計ジャッジ時間 | 5,459 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
import syssys.setrecursionlimit(10**6)int1 = lambda x: int(x)-1p2D = lambda x: print(*x, sep="\n")def II(): return int(sys.stdin.buffer.readline())def MI(): return map(int, sys.stdin.buffer.readline().split())def MF(): return map(float, sys.stdin.buffer.readline().split())def MI1(): return map(int1, sys.stdin.buffer.readline().split())def LI(): return list(map(int, sys.stdin.buffer.readline().split()))def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))def LLI(rows_number): return [LI() for _ in range(rows_number)]def BI(): return sys.stdin.buffer.readline().rstrip()def SI(): return sys.stdin.buffer.readline().rstrip().decode()dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]inf = 10**16# md = 998244353md = 10**9+7n, m, k = MI()lr = [(l-1, r) for l, r in LLI(m)]dp = [0]*(n+1)dp[0] = 1for _ in range(k):cs = [0]*(n+1)for i in range(n):cs[i+1] = (dp[i]+cs[i])%mddp = [0]*(n+1)for l, r in lr:cur = cs[r]-cs[l]dp[l] += curdp[r] -= curfor i in range(n):dp[i+1] = (dp[i+1]+dp[i])%mdprint(dp[n-1])