結果

問題 No.673 カブトムシ
ユーザー niinii
提出日時 2018-05-12 09:49:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,090 bytes
コンパイル時間 658 ms
コンパイル使用メモリ 78,856 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-09-10 18:19:04
合計ジャッジ時間 4,103 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
7,796 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=1e9+7;
//
//
struct poi{
  int X;int Y;int Z;
  bool operator<(const poi&R)const{
    return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
  }
};
//
///xのn乗をmodで返す
ll pow(ll x,ll n,ll mod){
  ll res=1;
  if(n>0){
    res=pow(x,n/2,mod);
    if(n%2==0){
      res=(res*res)%mod;
    }else{
      res=(((res*res)%mod)*x)%mod;
    }
  }
  return res;
}
int main(){
	ll B,C,D;
	cin>>B>>C>>D;
  ll  ans=0;
	FOR(i,1,D+1){
		(ans+=B*pow(C,i,mod))%=mod;
	}
	cout<<ans<<endl;
	return 0;
}
0