結果

問題 No.403 2^2^2
ユーザー 0w10w1
提出日時 2016-12-12 12:28:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,104 bytes
コンパイル時間 1,716 ms
コンパイル使用メモリ 166,400 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-07 03:15:27
合計ジャッジ時間 2,730 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
5,376 KB
testcase_14 WA -
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 1 ms
5,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

typedef long long ll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vl;
typedef vector< vl > vvl;
typedef pair< int, int > pii;
typedef vector< pii > vp;
typedef vector< double > vd;
typedef vector< vd > vvd;
typedef vector< string > vs;

template< class T1, class T2 >
int upmin( T1 &x, T2 v ){
  if( x > v ){
    x = v;
    return 1;
  }
  return 0;
}

template< class T1, class T2 >
int upmax( T1 &x, T2 v ){
  if( x < v ){
    x = v;
    return 1;
  }
  return 0;
}

const int INF = 0x3f3f3f3f;
const int MOD7 = ( int ) 1e9 + 7;

ll A, B, C;

void init(){
  scanf( "%lld^%lld^%lld", &A, &B, &C );
}

ll ll_pow( ll v, ll p, ll mod ){
  v %= mod;
  ll res = 1LL;
  while( p ){
    if( p & 1LL )
      ( res *= v ) %= mod;
    p >>= 1;
    ( v *= v ) %= mod;
  }
  return res;
}

void preprocess(){
  
}

void solve(){
  cout << ll_pow( ll_pow( A, B, MOD7 ), C, MOD7 ) << " " << ll_pow( A, ll_pow( B, C, MOD7 ), MOD7 ) << endl;
}

signed main(){
  // ios::sync_with_stdio( 0 );
  init();
  preprocess();
  solve();
  return 0;
}
0