結果

問題 No.1885 Flat Permutation
ユーザー ShirotsumeShirotsume
提出日時 2021-11-15 12:25:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 528 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 77,848 KB
最終ジャッジ日時 2023-09-02 07:40:25
合計ジャッジ時間 5,945 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
77,848 KB
testcase_01 AC 81 ms
77,572 KB
testcase_02 AC 82 ms
77,600 KB
testcase_03 AC 80 ms
77,580 KB
testcase_04 AC 82 ms
77,580 KB
testcase_05 AC 81 ms
77,580 KB
testcase_06 AC 81 ms
77,580 KB
testcase_07 AC 81 ms
77,716 KB
testcase_08 AC 82 ms
77,748 KB
testcase_09 AC 82 ms
77,604 KB
testcase_10 AC 81 ms
77,584 KB
testcase_11 AC 81 ms
77,496 KB
testcase_12 AC 81 ms
77,576 KB
testcase_13 AC 82 ms
77,752 KB
testcase_14 AC 83 ms
77,684 KB
testcase_15 AC 81 ms
77,584 KB
testcase_16 AC 82 ms
77,576 KB
testcase_17 AC 81 ms
77,544 KB
testcase_18 AC 82 ms
77,788 KB
testcase_19 AC 82 ms
77,636 KB
testcase_20 AC 82 ms
77,388 KB
testcase_21 AC 81 ms
77,524 KB
testcase_22 AC 81 ms
77,788 KB
testcase_23 AC 81 ms
77,580 KB
testcase_24 AC 84 ms
77,584 KB
testcase_25 AC 82 ms
77,604 KB
testcase_26 AC 84 ms
77,572 KB
testcase_27 AC 82 ms
77,392 KB
testcase_28 AC 82 ms
77,460 KB
testcase_29 AC 81 ms
77,612 KB
testcase_30 AC 81 ms
77,468 KB
testcase_31 AC 80 ms
77,576 KB
testcase_32 AC 85 ms
77,572 KB
testcase_33 AC 83 ms
77,792 KB
testcase_34 AC 83 ms
77,716 KB
testcase_35 AC 83 ms
77,584 KB
testcase_36 AC 84 ms
77,604 KB
testcase_37 AC 85 ms
77,584 KB
testcase_38 AC 83 ms
77,688 KB
testcase_39 AC 82 ms
77,388 KB
testcase_40 AC 82 ms
77,580 KB
testcase_41 AC 83 ms
77,480 KB
testcase_42 AC 81 ms
77,536 KB
testcase_43 AC 83 ms
77,624 KB
testcase_44 AC 83 ms
77,728 KB
testcase_45 AC 91 ms
77,480 KB
testcase_46 AC 84 ms
77,584 KB
権限があれば一括ダウンロードができます

ソースコード

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