結果
問題 |
No.403 2^2^2
|
ユーザー |
![]() |
提出日時 | 2020-06-02 13:49:01 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 681 bytes |
コンパイル時間 | 1,253 ms |
コンパイル使用メモリ | 158,032 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-23 18:26:58 |
合計ジャッジ時間 | 2,217 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:26:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 26 | scanf("%lld^%lld^%lld",&a,&b,&c); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
/** * @FileName a.cpp * @Author kanpurin * @Created 2020.06.02 13:46:50 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; //powMod ll powMod(ll k, ll n, ll mod) { ll x = 1; while (n > 0) { if (n & 1) { x = x * k % mod; } k = k * k % mod; n >>= 1; } return x; } int main() { const int MOD = 1000000007; ll a,b,c; scanf("%lld^%lld^%lld",&a,&b,&c); a %= MOD; if (a == 0) { cout << 0 << " " << 0 << endl; } cout << powMod(a,(b % (MOD - 1)) * (c % (MOD - 1)), MOD) << " "; cout << powMod(a,powMod((b % (MOD - 1)),c,MOD-1),MOD) << endl; return 0; }