結果
| 問題 | No.3584 Camouflage Mole |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-07-11 01:32:26 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 15 ms / 2,000 ms |
| + 355µs | |
| コード長 | 536 bytes |
| 記録 | |
| コンパイル時間 | 3,537 ms |
| コンパイル使用メモリ | 348,916 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-11 01:32:33 |
| 合計ジャッジ時間 | 5,246 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll MOD = 998244353;
ll modpow(ll x, ll a) {
ll res = 1;
while (a > 0) {
if (a & 1) res = res * x % MOD;
x = x * x % MOD;
a = (a >> 1);
}
return res;
}
int main() {
ll n; cin >> n;
//ans = nC4 * 26^(n - 4)
ll ans = n * (n - 1) % MOD * (n - 2) % MOD * (n - 3) % MOD;
ans = ans * modpow(1*2*3*4, MOD - 2) % MOD;
cout << ans * modpow(26, n - 4) % MOD << '\n';
}