QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 256 MB Total points: 100

#22339. 母牛的骰子

Statistics

Bessie 喜爱桌游与角色扮演游戏,因此说服 Farmer John 开车带她去爱好商店,买了三颗骰子。这些公平骰子分别有 $S1$、$S2$、$S3$ 个面,$(2 \le S1 \le 20; 2 \le S2 \le 20; 2 \le S3 \le 40)$。

Bessie 不停掷骰子,想知道三颗骰子的点数和中哪个出现最多。

给定三颗骰子各自的面数,求出现最频繁的点数和。若多个和并列最多,报告其中最小的。

输入格式

  • 第 1 行:三个空格分隔整数 $S1$、$S2$、$S3$。

输出格式

  • 第 1 行:所有可能组合中出现最多的最小整数和。

样例

输入格式 1

3 2 3

输出格式 1

5

说明

以下是全部可能结果。

1 1 1 -> 3  1 2 1 -> 4  2 1 1 -> 4  2 2 1 -> 5  3 1 1 -> 5  3 2 1 -> 6 1 1 2 -> 4  1 2 2 -> 5  2 1 2 -> 5  2 2 2 -> 6  3 1 2 -> 6  3 2 2 -> 7 1 1 3 -> 5  1 2 3 -> 6  2 1 3 -> 6  2 2 3 -> 7  3 1 3 -> 7  3 2 3 -> 8

5 和 6 都出现最多,各五次,所以答案是 5。

子任务

分值:70

题目作者:Rob Kolstad,2008

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.