結果

問題 No.673 カブトムシ
ユーザー aaaaaaiu
提出日時 2019-08-30 20:53:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 382 bytes
コンパイル時間 1,864 ms
コンパイル使用メモリ 193,104 KB
最終ジャッジ日時 2025-01-07 15:42:29
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 2
other AC * 5 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int mod=1e9+7;

ll mpow(ll a,ll b) {
    ll ans=1;
    while (b) {
        if (b&1)
            ans=(ans*a%mod+mod)%mod;
        a=a*a%mod;
        b>>=1;
    }
    return ans;
}

int main() {
    ll b,c,d;
    cin>>b>>c>>d;
    cout<<(b*c%mod*(1-mpow(c,d))%mod+mod)%mod*mpow(1-c,mod-2)%mod<<endl;
    return 0;
}
0