結果

問題 No.1035 Color Box
ユーザー achapiachapi
提出日時 2023-04-24 00:00:32
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 469 bytes
コンパイル時間 3,939 ms
コンパイル使用メモリ 257,560 KB
実行使用メモリ 9,296 KB
最終ジャッジ日時 2024-04-25 17:49:58
合計ジャッジ時間 5,578 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
7,760 KB
testcase_01 AC 12 ms
8,016 KB
testcase_02 AC 12 ms
8,016 KB
testcase_03 AC 14 ms
8,016 KB
testcase_04 AC 14 ms
8,400 KB
testcase_05 AC 12 ms
7,764 KB
testcase_06 AC 12 ms
7,632 KB
testcase_07 AC 11 ms
7,760 KB
testcase_08 AC 44 ms
8,144 KB
testcase_09 AC 24 ms
8,396 KB
testcase_10 AC 11 ms
7,760 KB
testcase_11 AC 11 ms
7,892 KB
testcase_12 AC 11 ms
8,140 KB
testcase_13 AC 37 ms
8,528 KB
testcase_14 AC 38 ms
9,168 KB
testcase_15 AC 49 ms
8,144 KB
testcase_16 AC 12 ms
7,756 KB
testcase_17 AC 11 ms
7,888 KB
testcase_18 AC 11 ms
9,296 KB
testcase_19 AC 45 ms
8,404 KB
testcase_20 AC 11 ms
7,888 KB
testcase_21 AC 12 ms
7,760 KB
testcase_22 AC 11 ms
7,760 KB
testcase_23 AC 11 ms
8,400 KB
testcase_24 AC 11 ms
8,020 KB
testcase_25 AC 11 ms
8,656 KB
testcase_26 AC 11 ms
8,528 KB
testcase_27 AC 11 ms
7,632 KB
testcase_28 AC 10 ms
7,632 KB
testcase_29 AC 12 ms
7,892 KB
testcase_30 AC 12 ms
8,404 KB
testcase_31 AC 11 ms
8,912 KB
testcase_32 AC 11 ms
7,892 KB
testcase_33 AC 12 ms
8,400 KB
testcase_34 AC 12 ms
7,760 KB
testcase_35 AC 11 ms
7,888 KB
testcase_36 AC 11 ms
8,140 KB
testcase_37 AC 11 ms
7,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using mint = atcoder::modint1000000007;
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<mint> fact = {1};
	for (int i = 1; i < 1010101; i++){
		fact.push_back(fact.back() * mint(i));
	}
	auto cmb = [&](int n,int r){
		return fact[n] / fact[n - r] / fact[r];
	};
	mint ans = 0;
	for (int i = 0; i <= m; i++){
		ans += mint(-1).pow(m - i) * cmb(m, i) * mint(i).pow(n);
	}
	cout << ans.val() << endl;
}
0