結果

問題 No.801 エレベーター
ユーザー 661nosyamuzuki661nosyamuzuki
提出日時 2019-03-17 23:05:03
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 482 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 27,480 KB
実行使用メモリ 8,756 KB
最終ジャッジ日時 2023-09-22 09:44:47
合計ジャッジ時間 4,143 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,756 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 20 ms
4,376 KB
testcase_04 AC 21 ms
4,376 KB
testcase_05 AC 20 ms
4,376 KB
testcase_06 AC 21 ms
4,380 KB
testcase_07 AC 22 ms
4,376 KB
testcase_08 AC 20 ms
4,384 KB
testcase_09 AC 21 ms
4,376 KB
testcase_10 AC 20 ms
4,376 KB
testcase_11 AC 18 ms
4,376 KB
testcase_12 AC 21 ms
4,380 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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>

#define mod 1000000007

int main(){
	int i,j,n,m,k,l,lr[3000][2];
	scanf("%d%d%d",&n,&m,&l);
	for(i=0;i<m;i++)scanf("%d%d",&lr[i][0],&lr[i][1]);
	long long dp[2][3001]={0};
	dp[0][1]=1;
	for(i=1;i<=l;i++){
		for(j=0;j<=n;j++)dp[i%2][j]=0;
		for(j=0;j<m;j++){
			long long sum=0;
			for(k=lr[j][0];k<=lr[j][1];k++)sum+=dp[(i+1)%2][k];
			sum%=mod;
			for(k=lr[j][0];k<=lr[j][1];k++)dp[i%2][k]=(dp[i%2][k]+sum)%mod;
		}
	}
	printf("%lld\n",dp[l%2][n]);
	return 0;
}
0