結果
問題 |
No.1186 長方形の敷き詰め
|
ユーザー |
|
提出日時 | 2020-08-22 13:44:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 381 bytes |
コンパイル時間 | 1,581 ms |
コンパイル使用メモリ | 168,692 KB |
実行使用メモリ | 11,240 KB |
最終ジャッジ日時 | 2024-10-15 07:58:37 |
合計ジャッジ時間 | 2,536 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 8 |
ソースコード
#include <bits/stdc++.h> using namespace std; long long mod=998244353; int main(){ int N,M; cin>>N>>M; if(N>M){cout<<1<<endl; return 0;} if(N==M){cout<<2<<endl; return 0;} int count=M-N; vector<long long>ans(count+3); ans[0]=1; ans[1]=1; ans[2]=2; for(int i=3;i<count+3;i++){ans[i]=ans[i-1]+ans[i-2];ans[i]%=mod;} cout<<ans[count+2]<<endl; }