結果

問題 No.403 2^2^2
ユーザー xxxasdfghjkxxxasdfghjk
提出日時 2018-10-05 19:52:18
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 462 bytes
コンパイル時間 1,333 ms
コンパイル使用メモリ 158,636 KB
実行使用メモリ 13,752 KB
最終ジャッジ日時 2024-04-20 16:54:28
合計ジャッジ時間 4,860 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,752 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 WA -
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:17:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |     scanf("%lld^%lld^%lld",&A,&B,&C);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

long long int bpow(long long int a,long long int n, long long int mod){
    long long int x = 1;
    while(n){
    if(n & 1)
        x *= a%mod;
    a = (a*a)%mod;
    n >>= 1;
    }
    return x;
}

int main(){
    long long int A,B,C,res1,res2,MOD=10E8+7;
    scanf("%lld^%lld^%lld",&A,&B,&C);
    res1 = bpow(bpow(A,B,MOD),C,MOD);
    res2 = bpow(A,bpow(B,C,MOD-1),MOD);
    cout << res1 << " " << res2 << endl;
}
0