結果

問題 No.801 エレベーター
ユーザー eQeeQe
提出日時 2021-03-19 12:32:27
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 1,162 bytes
コンパイル時間 4,079 ms
コンパイル使用メモリ 232,728 KB
実行使用メモリ 38,784 KB
最終ジャッジ日時 2024-04-29 01:20:20
合計ジャッジ時間 9,517 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 RE -
testcase_12 AC 3 ms
5,376 KB
testcase_13 AC 111 ms
38,528 KB
testcase_14 AC 107 ms
38,656 KB
testcase_15 AC 106 ms
38,400 KB
testcase_16 AC 108 ms
38,528 KB
testcase_17 AC 108 ms
38,528 KB
testcase_18 AC 108 ms
38,400 KB
testcase_19 RE -
testcase_20 AC 114 ms
38,528 KB
testcase_21 RE -
testcase_22 AC 110 ms
38,528 KB
testcase_23 AC 106 ms
38,400 KB
testcase_24 AC 103 ms
38,400 KB
testcase_25 AC 101 ms
38,528 KB
testcase_26 AC 100 ms
38,656 KB
testcase_27 RE -
testcase_28 AC 110 ms
38,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define pt(sth) cout << sth << "\n"
#define itr(x,c) for(auto x=c.begin();x!=c.end();x++)
#define all(a) (a.begin()),(a.end())
using namespace std;
#include <atcoder/all>
using namespace atcoder;
typedef long long ll;
typedef pair<ll, ll> pll;
template<class T>bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if(b<a) {a=b; return 1;} return 0;}
static const ll INF=1e18;
static const ll MAX=101010;
//static const ll MOD=1e9+7;
static const ll MOD=998244353;
//vector<ll> a(N);
//for(i=0;i<N;i++) cin>>a[i];

typedef vector<modint1000000007> v1d;
typedef vector<v1d> v2d;
typedef vector<v2d> v3d;



int main(void) {
  ll i,j,k;
  
  ll N,M,K;cin>>N>>M>>K;
  
  v2d dp(K+1,v1d(N+1,0));
  dp[0][1]=1;
  
  vector<ll> l(M),r(M);
  for(i=0;i<M;i++) cin>>l[i]>>r[i];
  
  for(k=0;k<K;k++){
    v1d sum(N+1,0);
    for(i=1;i<=N;i++) sum[i]=sum[i-1]+dp[k][i];
    
    for(i=0;i<M;i++){
      modint1000000007 t=sum[r[i]]-sum[l[i]-1];
      dp[k+1][l[i]]+=t;
      dp[k+1][r[i]+1]-=t;
    }
    
    for(i=1;i<N;i++) dp[k+1][i+1]+=dp[k+1][i];
  }
  
  pt(dp[K][N].val());
}




0