結果
| 問題 | 
                            No.1186 長方形の敷き詰め
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-08-22 13:39:39 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 380 bytes | 
| コンパイル時間 | 1,613 ms | 
| コンパイル使用メモリ | 169,292 KB | 
| 実行使用メモリ | 11,080 KB | 
| 最終ジャッジ日時 | 2024-10-15 07:54:13 | 
| 合計ジャッジ時間 | 2,397 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 15 WA * 9 | 
ソースコード
#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;
}