結果
| 問題 | No.2585 How many "Who is Santa?" | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-12-25 03:18:13 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,225 ms | 
| コード長 | 264 bytes | 
| コンパイル時間 | 4,176 ms | 
| コンパイル使用メモリ | 250,112 KB | 
| 最終ジャッジ日時 | 2025-02-18 14:26:41 | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 22 | 
ソースコード
#include <bits/stdc++.h>
#include<atcoder/all>
using namespace atcoder;
using namespace std;
using ll = long long;
using mint = modint998244353;
int main() {
    ll N;
    cin>>N;
    mint an=N;
    cout<<(an*(an-1).pow(N)-an*(an-1)*(an-3).pow(N-2)).val()<<endl;
}
            
            
            
        