QOJ.ac

QOJ

Límite de tiempo: 2 s Límite de memoria: 256 MB Puntuación total: 100

#22339. نرد الأبقار

Estadísticas

تحب 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.