結果
問題 | No.1518 Simple Combinatorics |
ユーザー |
|
提出日時 | 2021-05-28 21:33:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 330 bytes |
コンパイル時間 | 737 ms |
コンパイル使用メモリ | 69,084 KB |
最終ジャッジ日時 | 2025-01-21 19:52:29 |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 |
ソースコード
#include <atcoder/modint>#include <iostream>using namespace std;using mint = atcoder::modint1000000007;void solve() {int n, k;cin >> n >> k;cout << ((mint(n).pow(k) - mint(n - 1).pow(k)) * n).val() << "\n";}int main() {cin.tie(nullptr);ios::sync_with_stdio(false);solve();return 0;}