結果
問題 | No.8047 Riddle of Cards |
ユーザー |
![]() |
提出日時 | 2019-04-01 22:22:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 937 bytes |
コンパイル時間 | 1,570 ms |
コンパイル使用メモリ | 165,900 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-27 03:16:33 |
合計ジャッジ時間 | 1,836 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 |
ソースコード
#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.*/unsigned long long n,m;unsigned long long mod_pow(unsigned long long x,unsigned long long n){unsigned long long res=1;while(n){if(n&1) res*=x;x*=x;n>>=1;}return res;}int main(void){cin>>n>>m;if(n==16 && m==16){cout<<"18446744073709551616"<<endl;}else{cout<<mod_pow(m,n)<<endl;}return 0;}