結果

問題 No.1186 長方形の敷き詰め
ユーザー kotatsugame
提出日時 2020-08-22 15:27:10
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 553 ms
コンパイル使用メモリ 64,036 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-10-15 09:41:02
合計ジャッジ時間 1,534 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
const long mod=998244353;
long dp[1<<20];
long N,M;
main()
{
	cin>>N>>M;
	if(N==1)
	{
		cout<<1<<endl;
		return 0;
	}
	dp[0]=1;
	for(int i=0;i<M;i++)
	{
		if(i+N<=M)(dp[i+N]+=dp[i])%=mod;
		(dp[i+1]+=dp[i])%=mod;
	}
	cout<<dp[M]<<endl;
}
0