值班
|
Time Limit:1000MS Memory Limit:30000KB
Total Submit:985 Accepted:568
Description
马上就到6月份了,又要安排实验室值班人员了。PPP现在只有一份表格,上面记录着每个人每天是否可以值班。
Input
第一行为一个整数N,表示有N个人愿意参加值班。
接下来N行:
D11 D12 D13 ... -1
D21 D22 D23 ... -1
.......
.......
DN1 DN2 DN3 ... -1
Di表示第i个人在6月份的可以值班的时间, 每行均以-1结束
Output
输出yes如果6月份每天都有人值班, 否则输出no
Sample Input
2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -1
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 -1
Sample Output
yes
#include <stdio.h>
int main(){
int june[31] = {0};
int n = 0, day = 0, totalDay = 0;
scanf("%d", &n);
while(n--){
while(scanf("%d", &day) && day != -1)
if(june[day] == 0){
june[day] = 1;
totalDay++;
}
}
if(totalDay == 30)
printf("yes\n");
else
printf("no\n");
return 0;
}