QOJ.ac

QOJ

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

#22768. Tiệc năm mới

الإحصائيات

$N$ bò ($3 \le N \le 200$) dự tiệc năm mới. Mỗi con nấu vài loại thức ăn, đơn vị gọi là món. Tổng $D$ loại ($5 \le D \le 100$), số $1..D$.

điều phối viên bò muốn tối đa món, giới hạn mỗi loại. Mỗi bò mang $K$ món ($1 \le K \le 5$), khác nhau (không3 bánh bò, có thể bánh, bánh mì, cỏ linh lăng sốt cam). Tối đa bao nhiêu?

Dữ liệu vào

  • Dòng $1$: ba số nguyên $N$, $K$, $D$.
  • Dòng $2$: $D$ số nguyên không âm, giới hạn tổng từng loại.
  • Các dòng $3..N+2$: số nguyên đầu $Z$ ($1 \le Z \le D$) là số loại biết nấu; sau đó $Z$ mã món, loại đầu trước, thứ hai sau v.v.

Dữ liệu ra

Một dòng số nguyên, tối đa món.

Ví dụ

Dữ liệu vào 1

4 3 5
2 2 2 2 3
4 1 2 3 4
4 2 3 4 5
3 1 2 4
3 1 2 3

Dữ liệu ra 1

9

Ghi chú

Chi tiết đầu vào

dữ liệu — giải thích

  • 4 3 5 — 4 bò mỗi tối đa3 món,5 loại.
  • 2 2 2 2 3 — Loại1–4 tối đa2 mỗi loại,5 tối đa3.
  • 4 1 2 3 4 — Bò này nấu4 loại:1, 2, 3, 4.
  • 4 2 3 4 5 — Nấu4 loại:2, 3, 4, 5.
  • 3 1 2 4 — Nấu3 loại:1, 2, 4.
  • 3 1 2 3 — Nấu3 loại:1, 2, 3.

Chi tiết đầu ra

[Bò1 mang3, 4;2 mang3, 4, 5;3 mang1, 2;4 mang1, 2.]

Tác giả bài toán: Hal Burch, 2001

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.