結果

問題 No.2299 Antitypoglycemia
ユーザー Meet BrahmbhattMeet Brahmbhatt
提出日時 2023-05-14 18:36:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 812 bytes
コンパイル時間 1,808 ms
コンパイル使用メモリ 167,896 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-07 13:17:00
合計ジャッジ時間 2,291 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 3 ms
5,376 KB
testcase_13 AC 3 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 4 ms
5,376 KB
testcase_19 AC 3 ms
5,376 KB
testcase_20 AC 3 ms
5,376 KB
testcase_21 AC 3 ms
5,376 KB
testcase_22 AC 4 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 2 ms
5,376 KB
testcase_27 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *  - Meet Brahmbhatt
 *  - Hard work always pays off
**/
#include"bits/stdc++.h"
using namespace std;

#ifdef MeetBrahmbhatt
#include "debug.h"
#else
#define dbg(...) 72
#endif

#define endl "\n"
#define int long long

const long long INF = 4e18;
const int32_t M = 1e9 + 7;
const int32_t MM = 998244353;

void solve() {
    int n, a , b;
    cin >> n >> a >> b;
    vector<int> F(n + 1, 1);
    for (int i = 1; i <= n; i++) {
        F[i] = (F[i - 1] * i) % MM;
    }
    int ans = F[n] - F[n - 1] - F[n - 1];
    ans += MM;
    ans %= MM;
    if (a != b) {
        ans += F[n - 2];
        ans %= MM;
    }
    cout << ans;
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout << fixed << setprecision(9);
    int tt = 1;
    // cin >> tt;
    while (tt--) solve();
    return 0;
}
0