結果
| 問題 |
No.673 カブトムシ
|
| コンテスト | |
| ユーザー |
nii
|
| 提出日時 | 2018-05-12 09:49:00 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,090 bytes |
| コンパイル時間 | 677 ms |
| コンパイル使用メモリ | 81,152 KB |
| 実行使用メモリ | 13,760 KB |
| 最終ジャッジ日時 | 2024-06-28 09:31:26 |
| 合計ジャッジ時間 | 4,044 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | AC * 1 TLE * 1 -- * 12 |
ソースコード
#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;
}
nii