結果

問題 No.1885 Flat Permutation
ユーザー ShirotsumeShirotsume
提出日時 2021-11-15 12:23:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 77,796 KB
最終ジャッジ日時 2023-09-02 07:40:18
合計ジャッジ時間 5,925 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 82 ms
77,568 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 82 ms
77,608 KB
testcase_07 AC 82 ms
77,688 KB
testcase_08 AC 82 ms
77,728 KB
testcase_09 AC 82 ms
77,656 KB
testcase_10 AC 82 ms
77,612 KB
testcase_11 AC 83 ms
77,480 KB
testcase_12 AC 82 ms
77,584 KB
testcase_13 AC 82 ms
77,528 KB
testcase_14 AC 83 ms
77,480 KB
testcase_15 AC 84 ms
77,456 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 85 ms
77,584 KB
testcase_22 AC 84 ms
77,684 KB
testcase_23 AC 83 ms
77,520 KB
testcase_24 AC 83 ms
77,440 KB
testcase_25 WA -
testcase_26 AC 86 ms
77,796 KB
testcase_27 AC 83 ms
77,580 KB
testcase_28 AC 81 ms
77,608 KB
testcase_29 WA -
testcase_30 AC 81 ms
77,576 KB
testcase_31 AC 80 ms
77,464 KB
testcase_32 AC 82 ms
77,528 KB
testcase_33 AC 81 ms
77,692 KB
testcase_34 WA -
testcase_35 AC 81 ms
77,580 KB
testcase_36 AC 81 ms
77,520 KB
testcase_37 AC 79 ms
77,572 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x, y = map(int,input().split())
if y < x: x, y = y, x
mod = 998244353
dp = [0] * (2 * 10 ** 5 + 100)
#S = 0, T = N - 1の場合の答え
dp[0] = 1
for i in range(0, 2 * 10 ** 5 + 1):
    dp[i + 1] += dp[i]
    dp[i + 3] += dp[i]
    dp[i + 1] %= mod
    dp[i + 3] %= mod
if x == 1:
    x += 1
if y == n:
    y -= 1

print(dp[y - x])


0