結果

問題 No.3047 Riddle of Cards
ユーザー ahe100ahe100
提出日時 2019-04-01 22:16:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 786 bytes
コンパイル時間 1,461 ms
コンパイル使用メモリ 163,476 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-18 01:23:25
合計ジャッジ時間 1,959 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll mod = 1e9+7;

/*
There are 𝑁 cards on the table. Each cards are numbered from 1 to 𝑁. Mr.yuki should write an integer, which is no less than 1 and no more than 𝑀, on each cards. How many ways to write?
𝑁, 𝑀 are intgers between 1 and 16.
Output the answer in single line.
*/

ll n,m;

ll mod_pow(ll x,ll n){
	ll res=1;
	while(n){
		if(n&1) res*=x;
		x*=x;
		n>>=1;
	}
	return res;
}

int main(void){
	cin>>n>>m;
	cout<<mod_pow(m,n)<<endl;
	return 0;
}
0