結果

問題 No.1165 Paint Squares
ユーザー msm1993
提出日時 2020-09-11 16:20:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 530 bytes
コンパイル時間 641 ms
コンパイル使用メモリ 75,480 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 03:27:03
合計ジャッジ時間 1,586 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#define ll long long
using namespace std;

ll mpower(ll a,ll b,ll c){
    int z;
    if(b==0){
        z=1;
        z%=c;
        return z;
    }
    if(b==1){
        z=a;
        z%=c;
        return z;
    }
    else{
        return (((mpower(a,b/2,c))*(mpower(a,b/2,c))%c)*mpower(a,b%2,c)%c);
    }
}

int main() {
  ll mod=1000000007;
  ll p,q;
  cin>>p>>q;
  ll ans=6*((mpower(2,p,mod)+mpower(2,q,mod))%mod)-24;
  cout<<ans%mod;
}
0