結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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%M*a%M,b/2)*(b%2?a%M:1)%M:1;}
main()
{
	cin>>b>>c>>d;
	long B=b%M,C=c%M,D=d%M;
	if(c>1)cout<<B*C%M*(pow(C,d)-1+M)%M*pow((C-1+M)%M,M-2)%M<<endl;
	else cout<<B*D%M<<endl;
}
0