結果

問題 No.673 カブトムシ
ユーザー kotatsugame
提出日時 2018-06-26 02:12:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 234 bytes
コンパイル時間 724 ms
コンパイル使用メモリ 63,920 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 22:50:44
合計ジャッジ時間 1,475 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 6 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
long b,c,d,M=1e9+7;
long pow(long a,long b){return b?pow(a*a%M,b/2)*(b%2?a:1)%M:1;}
main()
{
	cin>>b>>c>>d;
	if(c>1)cout<<b*c%M*(pow(c,d)-1+M)%M*pow(c-1,M-2)%M<<endl;
	else cout<<b*d%M<<endl;
}
0