QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 2048 MB مجموع النقاط: 100

#9066. 四次骰子投掷

الإحصائيات

Ashley 和 Brandon 正在玩一个游戏,他们掷四次六面骰子。骰子的每个面上都有 1 到 6 之间的整数,且每个数值出现的概率相等。每次掷骰子时,他们都会记下顶面显示的数值,最终组成一个四位数。

如果这个四位数的四个数字各不相同,则 Ashley 获胜。否则,Brandon 获胜。

骰子目前已经掷了 1 到 3 次。请计算使得 Ashley 获胜的剩余掷骰子方式的数量,以及使得 Brandon 获胜的剩余掷骰子方式的数量。如果组成的整数不同,则视为不同的方式——例如,依次掷出 1、2、3、4 组成的整数是 1234,这与依次掷出 1、2、4、3 组成的整数 1243 是不同的。

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 3$),表示目前已经掷骰子的次数。 第二行包含 $n$ 个 1 到 6 之间的整数,按顺序表示前 $n$ 次掷骰子的结果。

输出格式

在一行中输出两个用空格分隔的整数,分别表示使得 Ashley 获胜的剩余掷骰子方式的数量,以及使得 Brandon 获胜的剩余掷骰子方式的数量。

样例

样例输入 1

2
1 2

样例输出 1

12 24

样例输入 2

2
3 3

样例输出 2

0 36

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.