結果
問題 | No.2351 Butterfly in Summer |
ユーザー |
|
提出日時 | 2023-06-22 00:53:35 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 606 bytes |
コンパイル時間 | 4,076 ms |
コンパイル使用メモリ | 252,264 KB |
最終ジャッジ日時 | 2025-02-14 23:58:05 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/all>using namespace std;using namespace atcoder;using ll = long long;constexpr ll MOD = 998244353;using mint = modint998244353;istream &operator>>(istream &is, mint &m) {ll n;is >> n;m = n;return is;}ostream &operator<<(ostream &os, const mint &m) { return os << m.val(); }mint operator^(const mint &x, const ll &n) { return x.pow(n); }mint operator^=(mint &x, const ll &n) { return x = x.pow(n); }int main() {ios::sync_with_stdio(false);cin.tie(0);ll n;mint k;cin >> n >> k;cout << k * (k - 1) * n / (k ^ n) << "\n";}