結果
| 問題 |
No.1518 Simple Combinatorics
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-28 23:02:52 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 254 bytes |
| コンパイル時間 | 2,026 ms |
| コンパイル使用メモリ | 195,792 KB |
| 最終ジャッジ日時 | 2025-01-21 20:17:25 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/modint>
using mint = atcoder::modint1000000007;
int main() {
int N, K;
cin >> N >> K;
mint ans = mint(N) * (mint(N).pow(K) - mint(N-1).pow(K));
cout << ans.val() << endl;
}