結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
77,612 KB
testcase_01 AC 80 ms
77,496 KB
testcase_02 AC 82 ms
77,328 KB
testcase_03 AC 82 ms
77,716 KB
testcase_04 AC 82 ms
77,436 KB
testcase_05 AC 81 ms
77,340 KB
testcase_06 AC 81 ms
77,360 KB
testcase_07 AC 81 ms
77,668 KB
testcase_08 AC 81 ms
77,444 KB
testcase_09 AC 81 ms
77,468 KB
testcase_10 AC 82 ms
77,444 KB
testcase_11 AC 81 ms
77,460 KB
testcase_12 AC 81 ms
77,480 KB
testcase_13 AC 82 ms
77,328 KB
testcase_14 AC 81 ms
77,500 KB
testcase_15 AC 82 ms
77,592 KB
testcase_16 AC 82 ms
77,308 KB
testcase_17 AC 82 ms
77,680 KB
testcase_18 AC 82 ms
77,436 KB
testcase_19 AC 82 ms
77,444 KB
testcase_20 AC 83 ms
77,584 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 81 ms
77,452 KB
testcase_24 AC 82 ms
77,592 KB
testcase_25 AC 82 ms
77,424 KB
testcase_26 AC 82 ms
77,440 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 82 ms
77,252 KB
testcase_30 AC 83 ms
77,340 KB
testcase_31 AC 81 ms
77,588 KB
testcase_32 AC 83 ms
77,496 KB
testcase_33 AC 81 ms
77,556 KB
testcase_34 AC 82 ms
77,548 KB
testcase_35 AC 83 ms
77,656 KB
testcase_36 AC 84 ms
77,612 KB
testcase_37 AC 83 ms
77,328 KB
testcase_38 AC 85 ms
77,452 KB
testcase_39 AC 84 ms
77,716 KB
testcase_40 AC 82 ms
77,500 KB
testcase_41 AC 83 ms
77,308 KB
testcase_42 AC 85 ms
77,328 KB
testcase_43 AC 80 ms
77,448 KB
testcase_44 AC 81 ms
77,448 KB
testcase_45 AC 88 ms
77,568 KB
testcase_46 AC 81 ms
77,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


0