結果

問題 No.1885 Flat Permutation
ユーザー titiatitia
提出日時 2022-03-25 21:53:20
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 22,528 KB
最終ジャッジ日時 2024-04-22 06:34:24
合計ジャッジ時間 9,223 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 162 ms
22,272 KB
testcase_02 AC 158 ms
22,400 KB
testcase_03 AC 163 ms
22,272 KB
testcase_04 AC 161 ms
22,400 KB
testcase_05 AC 160 ms
22,528 KB
testcase_06 AC 157 ms
22,272 KB
testcase_07 AC 161 ms
22,400 KB
testcase_08 AC 160 ms
22,400 KB
testcase_09 AC 159 ms
22,400 KB
testcase_10 AC 168 ms
22,272 KB
testcase_11 AC 158 ms
22,272 KB
testcase_12 AC 160 ms
22,400 KB
testcase_13 AC 164 ms
22,400 KB
testcase_14 AC 160 ms
22,272 KB
testcase_15 AC 163 ms
22,400 KB
testcase_16 AC 160 ms
22,400 KB
testcase_17 AC 165 ms
22,400 KB
testcase_18 AC 163 ms
22,400 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 162 ms
22,400 KB
testcase_22 AC 160 ms
22,400 KB
testcase_23 AC 164 ms
22,400 KB
testcase_24 AC 163 ms
22,400 KB
testcase_25 AC 166 ms
22,400 KB
testcase_26 AC 166 ms
22,400 KB
testcase_27 AC 163 ms
22,400 KB
testcase_28 AC 159 ms
22,400 KB
testcase_29 AC 161 ms
22,400 KB
testcase_30 AC 159 ms
22,400 KB
testcase_31 AC 161 ms
22,400 KB
testcase_32 AC 159 ms
22,272 KB
testcase_33 AC 158 ms
22,400 KB
testcase_34 AC 160 ms
22,400 KB
testcase_35 AC 161 ms
22,400 KB
testcase_36 AC 175 ms
22,272 KB
testcase_37 AC 164 ms
22,400 KB
testcase_38 AC 163 ms
22,272 KB
testcase_39 AC 167 ms
22,272 KB
testcase_40 AC 160 ms
22,272 KB
testcase_41 AC 164 ms
22,400 KB
testcase_42 AC 164 ms
22,400 KB
testcase_43 AC 160 ms
22,528 KB
testcase_44 AC 159 ms
22,272 KB
testcase_45 AC 159 ms
22,400 KB
testcase_46 AC 161 ms
22,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X,Y=map(int,input().split())
mod=998244353

DP=[0]*(3*10**5)

DP[0]=1

for i in range(1,3*10**5):
    DP[i]=(DP[i-1]+DP[i-3])%mod

k=abs(X-Y)

if X==1 or Y==1 or X==N or Y==N:
    print(DP[k-1])
else:
    if k-2<0:
        print(0)
    else:
        print(DP[k-2])
0