結果
問題 | No.403 2^2^2 |
ユーザー |
![]() |
提出日時 | 2018-06-06 15:25:21 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 621 bytes |
コンパイル時間 | 1,356 ms |
コンパイル使用メモリ | 158,440 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-30 10:15:24 |
合計ジャッジ時間 | 2,312 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 10 |
コンパイルメッセージ
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%mod*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-1),MOD); cout<<ansa<<" "<<ansb<<endl; return 0; }