ABC046B - AtCoDeerくんとボール色塗り / Painting Balls with AtCoDeer
問題:B - AtCoDeerくんとボール色塗り / Painting Balls with AtCoDeer
#include <cmath> #include <iostream> using namespace std; int main(void) { int n, k; cin.tie(0); ios::sync_with_stdio(false); cin >> n >> k; cout << k * (int)pow((k - 1), (n - 1)) << "\n"; return 0; }