| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 512 MB | 6 | 4 | 3 | 60.000% |
The Majestic Gourmet University offers the prestigious Majestic International Cooking Degree to a large number of students each year.
Every student has to take two mandatory classes: French Cuisine (FC) and Italian Cuisine (IC), taught by two disjoint groups of teachers: FC teachers and IC teachers. These classes take the form of weekly “cooking labs”, and have limited capacity: KFC students for FC labs and KIC students for IC labs. To accommodate all students, there are therefore several lab instances for both FC and IC every week, each with its specific weekly timeslot and assigned teacher. One added complication is that some of the teachers are in open conflict with each other, disagreeing on teaching methods.
Every year, the heads of the FC and IC departments come up with a number of propositions for the weekly lab instances, and let Wise Bob from the Planning Office choose a subset of these propositions so that each student can have a valid timetable, which means:
Wise Bob asks for your help to figure out which lab slots to pick and how to dispatch students to these labs, so as to achieve an optimal solution.
Note that some teachers may not be appointed to any lab instances, while others may be in charge of several labs.
The input comprises the following lines all consisting of integers separated by single spaces:
Limits
Note that no two propositions for the same teacher may overlap.
The output consists of an integer on a single line. This integer is either (i) 0, if no solution exists, or (ii) the minimal number of days of the week that contain the starting time of slots in an optimal solution.
90 2 45 2 2 1 9 0 0 2 15 0 1 5 30 2 2 1 8 0 0 2 14 0 0 3 15 15 0 1 16 25 0 1 17 10 1 1 0 1
2
50 2 30 2 2 1 9 0 0 2 10 10 1 2 40 2 2 1 10 40 0 2 12 10 1 1 1 0
0
ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2017 연습 세션 PE번