/* 1991 ACM Finals, Problem E, Use of Hospital Facilities Ed Karrels, Oct. 1996 */ int n_or, n_rrb; int time_or2rrb; int time_prepare_or; int time_prepare_rrb; int n_patients; int start_hour; enum Queues { WAIT_OR, IN_OR, XPORT, WAIT_RRB, IN_RRB, DONE }; struct { char name[9]; int min_surgery, min_recovery; int loc; int time2go; int time_in_surgery, time_out_surgery, or_no; int time_in_rrb, time_out_rrb, rrb_no; } patient[100]; struct { int patient_no; int time2go; int usage; } rrb[30], or[10]; int Hour(int time) { return time/60 + start_hour; } int Min(int time) { return time % 60; } int main() { int i, j; int have_patients; int time = 0; scanf("%d %d %d %d %d %d %d", &n_or, &n_rrb, &start_hour, &time_or2rrb, &time_prepare_or, &time_prepare_rrb, &n_patients); for (i=0; i 0) { patient[i].time2go--; } } for (i=0; i 0) { rrb[i].time2go--; if (rrb[i].patient_no != -1) rrb[i].usage++; } } for (i=0; i 0) { or[i].time2go--; if (or[i].patient_no != -1) or[i].usage++; } } time++; } time--; printf("Patient Operating Room Recovery Room\n"); printf("# Name Room# Begin End Bed# Begin End \n"); for (i=0; i