标签
- 全搜索、优先队列
题目地址
D - Cake 123
- https://atcoder.jp/contests/abc123/tasks/abc123_d
问题描述
The Patisserie AtCoder sells cakes with number-shaped candles. There are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively. Each cake has an integer value called deliciousness, as follows:
- The deliciousness of the cakes with 1-shaped candles are A 1 _1 1, A 2 _2 2, …, A X _X X.
- The deliciousness of the cakes with 2-shaped candles are B 1 _1 1, B 2 _2 2, …, B Y _Y Y.
- The deliciousness of the cakes with 3-shaped candles are C 1 _1 1, C 2 _2 2, …, C Z _Z Z.
Takahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.
There are X × \times × Y × \times × Z such ways to choose three cakes.
We will arrange these X × \times × Y × \times ×