結果
問題 |
No.2299 Antitypoglycemia
|
ユーザー |
|
提出日時 | 2024-02-21 17:34:08 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 579 bytes |
コンパイル時間 | 22,925 ms |
コンパイル使用メモリ | 353,728 KB |
最終ジャッジ日時 | 2025-02-19 18:36:04 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 WA * 1 |
ソースコード
#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> #include<atcoder/all> using namespace std; using namespace atcoder; using ll=long long; void IO(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); } ll P(ll p,ll mod){ ll res=1; for(ll i=1;i<=p;i++){ res*=i; res%=mod; } return res; } int main(){ IO(); ll n,a,b; cin>>n>>a>>b; ll mod=998244353; ll ans=P(n,mod); ans-=2*P(n-1,mod); ans+=mod; ans%=mod; if(a!=b){ ans+=P(n-2,mod); ans%=mod; } cout<<ans<<endl; }