結果

問題 No.1186 長方形の敷き詰め
ユーザー ffffff
提出日時 2020-08-22 13:19:26
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 1,892 bytes
コンパイル時間 1,398 ms
コンパイル使用メモリ 89,268 KB
実行使用メモリ 11,212 KB
最終ジャッジ日時 2023-08-05 10:11:12
合計ジャッジ時間 2,339 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 9 ms
11,144 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,384 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,384 KB
testcase_17 AC 4 ms
7,620 KB
testcase_18 AC 6 ms
9,532 KB
testcase_19 AC 7 ms
9,668 KB
testcase_20 AC 8 ms
10,156 KB
testcase_21 AC 6 ms
9,472 KB
testcase_22 AC 9 ms
11,212 KB
testcase_23 AC 6 ms
9,472 KB
testcase_24 AC 8 ms
10,332 KB
testcase_25 AC 6 ms
9,536 KB
testcase_26 AC 6 ms
9,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<algorithm>
#include<bitset>
#include<iostream>
#include<iomanip>
#include<set>
#include<string>
#include<math.h>
#include<stack>
#include<string>
#include<queue>
#include<vector>
using namespace std;
typedef long long int ll;
typedef pair<int, ll> P;

//--------------
///#define DEBUG
//--------------

#ifdef DEBUG
	#define debugprint(x) cout<<x<<" "
	#define debugendl cout<<endl
	#define debug(x) x
#else
	#define debugprint(x)
	#define debugendl
	#define debug(x)
#endif

class zahyo{
	public:
	int x;
	int y;
	zahyo(){
		x=0;
		y=0;
	}
	zahyo(int x_,int y_){
		x=x_;
		y=y_;
	}
	void print(){
		cout<<x<<" "<<y;
	}
	zahyo operator+(zahyo add){
		add.x=this->x+add.x;
		add.y=this->y+add.y;
		return add;
	}
	zahyo operator-(zahyo add){
		add.x=this->x-add.x;
		add.y=this->y-add.y;
		return add;
	}
	zahyo operator*(int t){
		zahyo temp;
		temp.x=this->x*t;
		temp.y=this->y*t;
		return temp;
	}
	zahyo operator%(int t){
		zahyo temp(this->x%t,this->y%t);
		return temp;
	}
	zahyo operator/(int t){
		zahyo temp(this->x/t,this->y/t);
		return temp;
	}
	bool operator==(const zahyo add) const{
		if(add.x==this->x and add.y==this->y){return true;}
		else{return false;}
	}
	bool operator!=(const zahyo add) const{
		if(add.x==this->x or add.y==this->y){return false;}
		else{return true;}
	}
	bool operator<(const zahyo add) const{
		if(this->x<add.x){return true;}
		else if(this->x==add.x and this->y<add.y){return true;}
		else{return false;}
	}
	bool operator>(const zahyo add) const{
		if(this->x>add.x){return true;}
		else if(this->x==add.x and this->y>add.y){return true;}
		else{return false;}
	}
	void input(){
		cin>>x>>y;
	}
};
long long int dp[1000005];
int main(){

	int n,m;
	cin>>n>>m;
	if(n==1){
		cout<<1<<endl;
		return 0;
	}
	dp[0]=1;
	for(int i=1;i<=m;i++){
		dp[i]=dp[i-1];
		if(i-n>=0){
			dp[i]+=dp[i-n];
		}
		dp[i]%=998244353;
	}
	cout<<dp[m]<<endl;
}
0