結果
問題 | No.8047 Riddle of Cards |
ユーザー |
![]() |
提出日時 | 2019-04-01 22:17:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 866 bytes |
コンパイル時間 | 1,362 ms |
コンパイル使用メモリ | 165,508 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-27 03:08:59 |
合計ジャッジ時間 | 1,796 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 6 WA * 1 |
ソースコード
#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; cout<<mod_pow(m,n)<<endl; return 0; }