結果
| 問題 |
No.403 2^2^2
|
| コンテスト | |
| ユーザー |
TAISA_
|
| 提出日時 | 2018-06-06 15:19:49 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 615 bytes |
| コンパイル時間 | 1,230 ms |
| コンパイル使用メモリ | 158,448 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-30 10:15:01 |
| 合計ジャッジ時間 | 2,336 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
21 | scanf("%lld^%lld^%lld",&a,&b,&c);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<ll,ll> P;
const ll MOD=1000000007;
const ll INF=1000000010;
const ll LINF=4000000000000000010LL;
const int MAX=310;
const double EPS=1e-3;
int dx[4]={0,1,0,1};
int dy[4]={0,0,1,1};
ll mod_pow(ll x,ll p,ll mod){
if(p==0)return 1;
ll res=mod_pow((x*x)%mod,p/2,mod);
if(p%2)(res*=x)%=mod;
return res;
}
int main(){
ll a,b,c;
scanf("%lld^%lld^%lld",&a,&b,&c);
ll ansa=mod_pow(mod_pow(a,b,MOD),c,MOD);
ll ansb=mod_pow(a,mod_pow(b,c,MOD),MOD);
cout<<ansa<<" "<<ansb<<endl;
return 0;
}
TAISA_