結果

問題 No.2299 Antitypoglycemia
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-12 22:03:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 889 ms
コンパイル使用メモリ 86,796 KB
実行使用メモリ 76,020 KB
最終ジャッジ日時 2023-08-19 04:48:32
合計ジャッジ時間 3,508 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,308 KB
testcase_01 AC 63 ms
71,172 KB
testcase_02 AC 62 ms
71,456 KB
testcase_03 AC 71 ms
75,756 KB
testcase_04 AC 72 ms
76,020 KB
testcase_05 AC 74 ms
75,880 KB
testcase_06 AC 74 ms
75,904 KB
testcase_07 AC 74 ms
75,876 KB
testcase_08 AC 75 ms
75,824 KB
testcase_09 AC 76 ms
75,956 KB
testcase_10 AC 76 ms
75,964 KB
testcase_11 AC 76 ms
75,908 KB
testcase_12 AC 74 ms
75,788 KB
testcase_13 AC 71 ms
76,016 KB
testcase_14 AC 67 ms
75,852 KB
testcase_15 AC 69 ms
75,956 KB
testcase_16 AC 71 ms
75,872 KB
testcase_17 AC 68 ms
76,016 KB
testcase_18 AC 71 ms
75,872 KB
testcase_19 AC 72 ms
75,708 KB
testcase_20 AC 73 ms
75,872 KB
testcase_21 AC 73 ms
75,828 KB
testcase_22 AC 71 ms
75,904 KB
testcase_23 AC 63 ms
71,304 KB
testcase_24 AC 61 ms
71,384 KB
testcase_25 AC 64 ms
71,156 KB
testcase_26 AC 64 ms
71,332 KB
testcase_27 AC 65 ms
71,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,a,b=map(int,input().split())
mod=998244353
s = 1
for i in range(n,0,-1):
    s=(s*i)%mod
    
if a != b:
    u=1
    for i in range(n-1,0,-1):
        u=(u*i)%mod
    su=1
    for i in range(n-2,0,-1):
        su=(su*i)%mod
    
    print((s-u-u+su)%mod)
    
else:
    u=1
    for i in range(n-1,0,-1):
        u=(u*i)%mod
    
    print((s-u-u)%mod)
    
    
    
    
0