結果

問題 No.895 MESE
ユーザー kotatsugamekotatsugame
提出日時 2019-09-27 22:20:57
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 591 bytes
コンパイル時間 600 ms
コンパイル使用メモリ 65,608 KB
実行使用メモリ 12,824 KB
最終ジャッジ日時 2023-10-24 22:38:30
合計ジャッジ時間 2,036 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
12,824 KB
testcase_01 AC 21 ms
12,824 KB
testcase_02 AC 22 ms
12,824 KB
testcase_03 AC 22 ms
12,824 KB
testcase_04 AC 21 ms
12,824 KB
testcase_05 AC 22 ms
12,824 KB
testcase_06 AC 22 ms
12,824 KB
testcase_07 AC 22 ms
12,824 KB
testcase_08 AC 21 ms
12,824 KB
testcase_09 AC 22 ms
12,824 KB
testcase_10 AC 22 ms
12,824 KB
testcase_11 AC 22 ms
12,824 KB
testcase_12 AC 22 ms
12,824 KB
testcase_13 AC 24 ms
12,824 KB
testcase_14 AC 27 ms
12,824 KB
testcase_15 AC 27 ms
12,824 KB
testcase_16 AC 24 ms
12,824 KB
testcase_17 AC 22 ms
12,824 KB
testcase_18 AC 28 ms
12,824 KB
testcase_19 AC 28 ms
12,824 KB
testcase_20 AC 27 ms
12,824 KB
testcase_21 AC 27 ms
12,824 KB
testcase_22 AC 27 ms
12,824 KB
testcase_23 AC 28 ms
12,824 KB
testcase_24 AC 28 ms
12,824 KB
testcase_25 AC 27 ms
12,824 KB
testcase_26 AC 27 ms
12,824 KB
testcase_27 AC 27 ms
12,824 KB
testcase_28 AC 29 ms
12,824 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
long mod=1e9+7;
long power(long a,long b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
int a,b,c;
long F[3<<17],I[3<<17];
long P2[3<<17];
main()
{
	cin>>a>>b>>c;
	F[0]=1;
	for(int i=1;i<3<<17;i++)F[i]=F[i-1]*i%mod;
	I[(3<<17)-1]=power(F[(3<<17)-1],mod-2);
	for(int i=(3<<17)-1;i--;)I[i]=I[i+1]*(i+1)%mod;
	P2[0]=1;
	for(int i=1;i<3<<17;i++)P2[i]=P2[i-1]*2%mod;
	long ans=0;
	for(int i=1;i<=a;i++)
	{
		int T=a-i+b-1+c;
		int A=a-i,B=b-1,C=c;
		long now=F[T-1]*I[A]%mod*I[B]%mod*I[C-1]%mod;
		(ans+=now*(P2[a+b+c-i-1]-1))%=mod;
	}
	cout<<ans<<endl;
}
0