結果

問題 No.3584 Camouflage Mole
コンテスト
ユーザー marc2825
提出日時 2026-05-05 14:56:27
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 624 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,093 ms
コンパイル使用メモリ 208,952 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-10 20:50:40
合計ジャッジ時間 2,698 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
const ll MOD = 998244353;


ll modpow(ll a, ll e) {
    ll res = 1;
    while (e > 0) {
        if (e & 1) res = res * a % MOD;
        a = a * a % MOD;
        e >>= 1;
    }
    return res;
}


int main() {
    ll N;
    cin >> N;

    // calculate C(N, 4)
    ll comb = 1;
    comb = comb * N % MOD;
    comb = comb * (N - 1) % MOD;
    comb = comb * (N - 2) % MOD;
    comb = comb * (N - 3) % MOD;
    const ll INV = modpow(1*2*3*4, MOD - 2);
    comb = comb * INV % MOD;

    ll ans = comb * modpow(26, N - 4) % MOD;
    cout << ans;

    return 0;
}
0