結果

問題 No.1885 Flat Permutation
ユーザー k_o_pasturek_o_pasture
提出日時 2022-03-25 22:52:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 263 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 18,560 KB
最終ジャッジ日時 2024-04-22 07:40:42
合計ジャッジ時間 3,853 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,368 KB
testcase_01 AC 29 ms
10,496 KB
testcase_02 WA -
testcase_03 AC 28 ms
10,624 KB
testcase_04 AC 26 ms
10,624 KB
testcase_05 AC 25 ms
10,496 KB
testcase_06 AC 27 ms
10,496 KB
testcase_07 AC 26 ms
10,624 KB
testcase_08 AC 26 ms
10,624 KB
testcase_09 AC 26 ms
10,368 KB
testcase_10 AC 26 ms
10,496 KB
testcase_11 AC 26 ms
10,624 KB
testcase_12 AC 26 ms
10,624 KB
testcase_13 AC 25 ms
10,496 KB
testcase_14 AC 25 ms
10,496 KB
testcase_15 AC 25 ms
10,624 KB
testcase_16 AC 26 ms
10,496 KB
testcase_17 AC 27 ms
10,496 KB
testcase_18 AC 27 ms
10,368 KB
testcase_19 AC 115 ms
18,304 KB
testcase_20 AC 119 ms
18,560 KB
testcase_21 AC 118 ms
18,432 KB
testcase_22 AC 108 ms
17,792 KB
testcase_23 AC 28 ms
10,368 KB
testcase_24 AC 27 ms
10,624 KB
testcase_25 WA -
testcase_26 AC 27 ms
10,624 KB
testcase_27 AC 115 ms
18,432 KB
testcase_28 AC 115 ms
18,304 KB
testcase_29 AC 113 ms
18,432 KB
testcase_30 AC 116 ms
18,560 KB
testcase_31 AC 113 ms
18,304 KB
testcase_32 AC 26 ms
10,624 KB
testcase_33 AC 27 ms
10,496 KB
testcase_34 WA -
testcase_35 AC 113 ms
18,432 KB
testcase_36 AC 116 ms
18,304 KB
testcase_37 AC 26 ms
10,496 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 42 ms
11,776 KB
testcase_41 AC 64 ms
13,824 KB
testcase_42 AC 32 ms
11,136 KB
testcase_43 AC 115 ms
18,304 KB
testcase_44 AC 118 ms
18,432 KB
testcase_45 AC 113 ms
18,304 KB
testcase_46 AC 113 ms
18,560 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X, Y = map(int, input().split())
if Y < X:
	X, Y = Y, X
mod = 998244353
if X != 1:
	X += 1
if Y != N:
	Y -= 1

L = Y-X + 1
if L <= 2:
	print(1)
	exit()
dp = [1 for _ in range(L)]
for l in range(3, L):
	# print(l)
	dp[l] = (dp[l-3] + dp[l-1])%mod
print(dp[L-1])
0