結果
| 問題 | No.2299 Antitypoglycemia |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-05-12 21:53:25 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 624 bytes |
| 記録 | |
| コンパイル時間 | 2,497 ms |
| コンパイル使用メモリ | 187,180 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-30 14:48:31 |
| 合計ジャッジ時間 | 3,627 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 25 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)
using mint = modint998244353;
int main(){
int n,x,y;
cin >> n >> x >> y;
mint a = 1;
mint b = 1;
mint c = 1;
for (int i = 0; i < n;i++){
c *= (i+1);
if (i < n-1) a *= (i+1);
if (i < n-2) b *= (i+1);
}
if (x == y) b = 0;
cout << (c-a-a+b).val() << endl;
return 0;
}