結果
| 問題 |
No.2299 Antitypoglycemia
|
| コンテスト | |
| ユーザー |
ぷら
|
| 提出日時 | 2023-05-12 22:42:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 521 bytes |
| コンパイル時間 | 1,915 ms |
| コンパイル使用メモリ | 193,228 KB |
| 最終ジャッジ日時 | 2025-02-12 23:22:16 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
constexpr int mod = 998244353;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int ans = 1;
int n,a,b;
cin >> n >> a >> b;
if(a != b) {
ans = (n-1)+1ll*(n-2)*(n-2)%mod;
ans %= mod;
for(int i = 1; i <= n-2; i++) {
ans = 1ll*ans*i%mod;
}
}
else {
ans = 1ll*(n-2)%mod;
for(int i = 1; i <= n-1; i++) {
ans = 1ll*i%mod;
}
}
cout << ans << "\n";
}
ぷら