結果

問題 No.2299 Antitypoglycemia
ユーザー 👑 H20H20
提出日時 2023-05-19 09:15:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 184 bytes
コンパイル時間 2,060 ms
コンパイル使用メモリ 86,584 KB
実行使用メモリ 89,784 KB
最終ジャッジ日時 2023-08-22 17:46:42
合計ジャッジ時間 6,036 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,264 KB
testcase_01 AC 74 ms
71,160 KB
testcase_02 AC 74 ms
71,020 KB
testcase_03 AC 84 ms
84,028 KB
testcase_04 AC 88 ms
85,140 KB
testcase_05 AC 84 ms
80,196 KB
testcase_06 AC 86 ms
84,076 KB
testcase_07 AC 82 ms
76,916 KB
testcase_08 AC 85 ms
83,820 KB
testcase_09 AC 85 ms
85,156 KB
testcase_10 AC 79 ms
78,304 KB
testcase_11 AC 81 ms
78,612 KB
testcase_12 AC 88 ms
84,900 KB
testcase_13 AC 92 ms
89,580 KB
testcase_14 AC 79 ms
75,908 KB
testcase_15 AC 79 ms
75,652 KB
testcase_16 AC 83 ms
79,312 KB
testcase_17 AC 79 ms
76,928 KB
testcase_18 AC 90 ms
89,288 KB
testcase_19 AC 91 ms
89,416 KB
testcase_20 AC 94 ms
89,624 KB
testcase_21 AC 91 ms
89,372 KB
testcase_22 AC 90 ms
89,784 KB
testcase_23 AC 75 ms
70,960 KB
testcase_24 AC 77 ms
70,948 KB
testcase_25 AC 78 ms
71,000 KB
testcase_26 AC 77 ms
71,096 KB
testcase_27 AC 75 ms
71,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,A,B = map(int,input().split())
P = [1]
mod = 998244353
for i in range(1,N+1):
    P.append(P[-1]*i%mod)
if A==B:
    print(P[N]-P[N-1]*2)
else:
    print((P[N]-P[N-1]*2+P[N-2])%mod)
0