結果
問題 |
No.403 2^2^2
|
ユーザー |
![]() |
提出日時 | 2016-07-25 07:36:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 786 bytes |
コンパイル時間 | 1,259 ms |
コンパイル使用メモリ | 158,828 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-06 16:16:58 |
合計ジャッジ時間 | 2,246 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 2 WA * 25 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:36:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 36 | 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 = 10e+7; ll mpow(ll a, ll b){ if(b == 0) return 1; if(b == 1) return a%M; if(b%2 == 0){ return (mpow(a,b/2)*mpow(a,b/2))%M; }else{ return (mpow(a,b-1)*a)%M; } } int main(){ scanf("%lld^%lld^%lld", &a,&b,&c); cout<<mpow(mpow(a,b),c)<<" "<<mpow(a,mpow(b,c))<<endl; return 0; }