Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 509 Bytes

052.md

File metadata and controls

36 lines (28 loc) · 509 Bytes

052 - Dice Product (★3)

解答

#include <iostream>
#include <array>
#include <numeric> // std::reduce()

int main()
{
	// N 個のサイコロ
	int N;
	std::cin >> N;

	long long count = 1;

	for (int i = 0; i < N; ++i)
	{
		// 6 つの目の値を入力
		std::array<int, 6> A;
		for (auto& a : A)
		{
			std::cin >> a;
		}

		// 6 つの目の合計を乗算
		count *= std::reduce(A.begin(), A.end());
		
		count %= 1'000'000'007;
	}

	// 解答を出力
	std::cout << count << '\n';
}