結果

問題 No.801 エレベーター
ユーザー youluoyyouluoy
提出日時 2019-03-17 23:40:42
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,006 bytes
コンパイル時間 2,175 ms
コンパイル使用メモリ 164,256 KB
実行使用メモリ 75,284 KB
最終ジャッジ日時 2023-09-22 14:38:38
合計ジャッジ時間 4,760 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 4 ms
10,072 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 4 ms
10,036 KB
testcase_09 AC 5 ms
10,048 KB
testcase_10 AC 4 ms
10,124 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 122 ms
75,236 KB
testcase_17 AC 124 ms
75,064 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 124 ms
75,076 KB
testcase_22 WA -
testcase_23 AC 119 ms
75,284 KB
testcase_24 AC 117 ms
75,092 KB
testcase_25 AC 118 ms
75,032 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 121 ms
75,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int long long
#define mk make_pair
#define pb push_back
#define pf push_front
typedef pair<int, int> pii;
#define INF (1 << 30)
#define INFL (1ll << 60ll);
#define mod 1000000007
#define se second
#define fi first

int N, M, K;
int L[3030], R[3030];
int U[3030], O[3030];
int dp[3030][3030];

signed main()
{
    cin >> N >> M >> K;
    for(int i = 0; i < M; i++){
        cin >> L[i] >> R[i];
    }
    dp[0][1] = 1;
    for(int i = 0; i < K; i++){
        for(int j = 1; j <= N; j++){
            dp[i][j] += dp[i][j - 1];
            dp[i][j] %= mod;
        }
        for(int j = 0; j < M; j++){
            int sum = dp[i][R[j]] - dp[i][L[j] - 1];
            dp[i + 1][L[j]] += sum;
            dp[i + 1][R[j] + 1] -= sum;
        }
        for(int j = 1; j <= N; j++){
            dp[i + 1][j] += dp[i + 1][j - 1];
            dp[i + 1][j] %= mod;
        }
    }
    cout << dp[K][N] << endl;




    return 0;
}

/*



*/
0