結果

問題 No.1885 Flat Permutation
ユーザー minimumminimum
提出日時 2022-03-25 21:55:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 305 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 130,304 KB
最終ジャッジ日時 2024-04-22 06:36:36
合計ジャッジ時間 7,023 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
130,304 KB
testcase_01 AC 113 ms
129,792 KB
testcase_02 AC 117 ms
129,920 KB
testcase_03 AC 112 ms
130,176 KB
testcase_04 AC 113 ms
129,920 KB
testcase_05 AC 111 ms
130,048 KB
testcase_06 AC 112 ms
130,048 KB
testcase_07 AC 114 ms
130,048 KB
testcase_08 AC 113 ms
129,920 KB
testcase_09 AC 113 ms
130,048 KB
testcase_10 AC 112 ms
130,048 KB
testcase_11 AC 113 ms
130,176 KB
testcase_12 AC 113 ms
130,304 KB
testcase_13 AC 114 ms
129,920 KB
testcase_14 AC 113 ms
130,304 KB
testcase_15 AC 113 ms
130,048 KB
testcase_16 AC 112 ms
130,048 KB
testcase_17 AC 113 ms
130,176 KB
testcase_18 AC 112 ms
130,176 KB
testcase_19 AC 112 ms
129,920 KB
testcase_20 AC 111 ms
130,304 KB
testcase_21 AC 111 ms
129,920 KB
testcase_22 AC 110 ms
129,920 KB
testcase_23 AC 112 ms
130,176 KB
testcase_24 AC 110 ms
130,048 KB
testcase_25 AC 112 ms
130,048 KB
testcase_26 AC 111 ms
130,176 KB
testcase_27 AC 112 ms
130,176 KB
testcase_28 AC 115 ms
129,920 KB
testcase_29 AC 113 ms
129,920 KB
testcase_30 AC 114 ms
130,176 KB
testcase_31 AC 115 ms
130,176 KB
testcase_32 AC 114 ms
130,048 KB
testcase_33 AC 113 ms
130,304 KB
testcase_34 AC 113 ms
130,048 KB
testcase_35 AC 113 ms
130,304 KB
testcase_36 AC 112 ms
129,792 KB
testcase_37 AC 113 ms
129,920 KB
testcase_38 AC 112 ms
130,304 KB
testcase_39 AC 117 ms
130,304 KB
testcase_40 AC 112 ms
129,920 KB
testcase_41 AC 112 ms
129,792 KB
testcase_42 AC 114 ms
129,920 KB
testcase_43 AC 112 ms
130,176 KB
testcase_44 AC 112 ms
130,176 KB
testcase_45 AC 112 ms
130,176 KB
testcase_46 AC 114 ms
130,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
fib = [1, 1, 1]
for i in range(10 ** 6):
    fib.append((fib[-1] + fib[-3]) % MOD)

N, X, Y = map(int, input().split())
mx, mn = max(X, Y), min(X, Y)

if mn == 1:
    L = 1
else:
    L = mn + 1
if mx == N:
    R = N
else:
    R = mx - 1

if L > R:
    print(0)
else:
    print(fib[R - L])
0