Diagnosis
면접 대비시간 제한1초메모리 제한2048 MB
각 질병의 증상 집합과 진단된 질병 부분집합이 주어질 때, 그 증상들의 합집합이 환자의 전체 증상과 정확히 일치하는지 판정한다.
문제
In the PHP (Paradise Hospital of Prague) they cure people with a lot of different diseases. The PHP is dealing with a shortage of medical personal, therefore the director is afraid of doctors getting sloppy. Doctors make a diagnosis based on the knowledge they gained in university. So there is a known list of possible diseases and a known list of possible symptoms a patient can have. A doctor makes a diagnosis of one or multiple diseases. Those diseases have known symptoms that need to match exactly with the symptoms of the patient.
More formally: given a set of diseases , a set of symptoms and a function that represents the knowledge about diseases and their symptoms. with and . When a given check whether or not the the condition is true. When it is print "yes" else print "no".
입력
- One line with two integers and , with the number of diseases and the number of symptoms. The patient has all symptoms to .
- One line with one integer followed by integers: the set of diseases the patient has according to the doctor .
- lines, corresponding to diseases to , with an integer followed by integers: The symptoms belonging to disease . These symptoms are given in ascending order.
출력
Print "yes" if the symptoms of the diagnosed diseases exactly match the patient's symptoms. Print "no" otherwise.