QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 256 MB Points totaux : 100

#22650. צוות חקר

Statistiques

הפרות רוצות ליצור משלחת לחקור את היער בקצה אדמת Farmer John. חקר דורש יותר כישורים מעמידה במרעה ואכילת עשב.

צוות של $C$ פרות ($1 \le C \le 20$), שמספריהן 1..$C$, צריך לנווט בלי ללכת לאיבוד, להדוף יצורים גדולים ורעים, לספר בדיחות להעלאת המורל וכו׳. לפחות פרה אחת בצוות חייבת להחזיק בכל אחת מ־$A$ היכולות המיוחדות ($1 \le A \le 20$), שמספריהן 1..$A$. לחלק יכולת אחת, לרבות כמה יכולות, וחלק טרמפיסטיות חסרות תועלת לגמרי.

בהינתן כל הפרות ויכולותיהן, חשבו את מספר צוותי החקר השונים שמחזיקים יחד בכל היכולות הנתונות.

קלט

  • שורה 1: שני מספרים שלמים $C$ ו־$A$.
  • שורות 2..$A$+1: כל שורה מתארת יכולת במספרים שלמים המופרדים ברווחים. שורה 2 ליכולת 1, שורה 3 ליכולת 2 וכו׳. המספר הראשון $K$ ($1 \le K \le C$) הוא מספר הפרות עם היכולת. $K$ המספרים הבאים מציינים אותן.

פלט

  • שורה 1: מספר שלם, מספר צוותי החקר השונים האפשריים.

דוגמאות

קלט 1

4 2
2 3 1
1 2

פלט 1

6

הערה

פרטי הקלט

יש 4 פרות ו־2 יכולות. לפרות 1 ו־3 יכולת 1, ורק לפרה 2 יכולת 2. פרה 4 חסרת כישרון למדי.

פרטי הפלט

הצוותים האפשריים הם $\{1, 2\}$, $\{2, 3\}$, $\{1, 2, 3\}$, $\{1, 2, 4\}$, $\{2, 3, 4\}$ ו־$\{1, 2, 3, 4\}$.

מחבר הבעיה: Percy Liang, 2004

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.