結果

問題 No.673 カブトムシ
ユーザー kotatsugamekotatsugame
提出日時 2018-06-26 02:12:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 234 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 65,036 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-13 14:04:40
合計ジャッジ時間 1,326 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,380 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-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