結果

問題 No.801 エレベーター
ユーザー asdf1asdf1
提出日時 2019-03-17 23:14:59
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,577 bytes
コンパイル時間 2,189 ms
コンパイル使用メモリ 145,524 KB
実行使用メモリ 12,700 KB
最終ジャッジ日時 2023-09-22 10:20:04
合計ジャッジ時間 5,366 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
11,908 KB
testcase_01 AC 2 ms
7,476 KB
testcase_02 AC 3 ms
7,772 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
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 #

#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 

ll n,cnt,ans,a,b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,k,l[ohara],r[ohara];
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};
ll dp[4000][4000];
ll cntt=0;

//-------------------------↓↓↓↓↓↓------------------------

int main(void){
       cin.tie(0);
    ios::sync_with_stdio(false);

    cin>>n>>m>>k;
    rep(i,m)cin>>l[i]>>r[i];

    dp[0][1]=1;
    rrep(i,1,k+1){
        rrep(j,1,n+1){
            ///////////////////
            rep(z,m){
                /////////////ここは
                if(l[z]<=j&&j<=r[z]){
                    rrep(zz,l[z],r[z]+1){
                        (cnt+=dp[i-1][zz])%=MOD;
                        //cntt++;
                    }
                }
                ////////////
            }
            //////////////////////
            (dp[i][j]+=cnt)%=MOD;
            cnt=0;
            cntt=0;
        }
    }
    Cout(dp[k][n]%MOD);
    return 0;
}
0