結果

問題 No.1186 長方形の敷き詰め
ユーザー cpcznksutbeoacpcznksutbeoa
提出日時 2020-08-22 13:39:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 1,709 ms
コンパイル使用メモリ 164,516 KB
実行使用メモリ 11,232 KB
最終ジャッジ日時 2024-04-23 08:05:25
合計ジャッジ時間 2,623 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 WA -
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 WA -
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 2 ms
6,940 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0