結果
問題 |
No.403 2^2^2
|
ユーザー |
![]() |
提出日時 | 2016-07-25 08:01:04 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 812 bytes |
コンパイル時間 | 1,272 ms |
コンパイル使用メモリ | 157,928 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-06 16:17:10 |
合計ジャッジ時間 | 2,223 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:34:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 34 | scanf("%lld^%lld^%lld", &a,&b,&c); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
// g++ -std=c++11 temp.cpp #include <bits/stdc++.h> using namespace std; #define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define REP(i,n) FOR(i,0,n) #define EACH(itr,v) for(auto itr:v) #define pb(s) push_back(s) #define mp(a,b) make_pair(a,b) #define all(x) (x).begin(),(x).end() #define dbg(x) cout<<#x"="<<x<<endl typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<P, int> PPI; #define INF INT_MAX/3 #define MAX_N 1000 ll a,b,c; const ll M = 1000000007; ll mpow(ll a, ll b, ll m){ if(a%m==0) return 0; if(b == 0) return 1; ll res = mpow(a*a%m, b/2, m); if(b&1) res = res*a%m; return res; } int main(){ scanf("%lld^%lld^%lld", &a,&b,&c); //dbg(mpow(2000000014,10,M)); cout<<mpow(mpow(a,b,M),c,M)<<" "<<mpow(a,mpow(b,c,M-1),M)<<endl; return 0; }