結果

問題 No.2585 How many "Who is Santa?"
ユーザー Yoichiro NishimuraYoichiro Nishimura
提出日時 2023-12-20 20:27:42
言語 PHP
(8.3.4)
結果
AC  
実行時間 44 ms / 1,225 ms
コード長 212 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 32,412 KB
実行使用メモリ 33,180 KB
最終ジャッジ日時 2023-12-20 20:27:45
合計ジャッジ時間 2,088 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
33,180 KB
testcase_01 AC 44 ms
33,180 KB
testcase_02 AC 44 ms
33,180 KB
testcase_03 AC 40 ms
33,180 KB
testcase_04 AC 41 ms
33,180 KB
testcase_05 AC 44 ms
33,180 KB
testcase_06 AC 44 ms
33,180 KB
testcase_07 AC 42 ms
33,180 KB
testcase_08 AC 41 ms
33,180 KB
testcase_09 AC 43 ms
33,180 KB
testcase_10 AC 44 ms
33,180 KB
testcase_11 AC 43 ms
33,180 KB
testcase_12 AC 44 ms
33,180 KB
testcase_13 AC 44 ms
33,180 KB
testcase_14 AC 42 ms
33,180 KB
testcase_15 AC 41 ms
33,180 KB
testcase_16 AC 44 ms
33,180 KB
testcase_17 AC 42 ms
33,180 KB
testcase_18 AC 41 ms
33,180 KB
testcase_19 AC 41 ms
33,180 KB
testcase_20 AC 41 ms
33,180 KB
testcase_21 AC 42 ms
33,180 KB
testcase_22 AC 43 ms
33,180 KB
testcase_23 AC 42 ms
33,180 KB
testcase_24 AC 43 ms
33,180 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
define("MOD", 998244353);
$N = intval(readline());
$ans = ($N * bcpowmod($N-1, $N, MOD)) % MOD;
$ans -= ($N * ($N-1) % MOD * bcpowmod($N-3, $N-2, MOD)) % MOD;
$ans %= MOD;
$ans+=MOD;
$ans %= MOD;
echo $ans;
0