12743 - Quiz2_COVID-19 Simulation   

Description

Description:

  • The simulation takes place in one matrix r_1×c_1  and an ICU list with capacity k
  • Initially, people will be randomly placed in the matrix
    • Either healthy, masked, or tested positive for COVID-19
    • It will be very sparse at the beginning
  • People will be inserted into the regular matrix from time to time
    • Example: 4 101 33 Alice Healthy
    • Example2: 5 101 34 Bob Masked
    • Example3: 8 53 21 Xeno Sick
    • Example4: 8 101 32 John Sick

Specification:

  • Healthy people with mask will remain healthy
  • Healthy people without masks will be infected by ill people in the orthogonally adjacent cells.
    • For example, in the samples we give at previous slide, Alice will be infected by John at Time t=8 and become sick at Time t=9
  • Initially, the recovery time for all sick people is 14 days.
  • Every sick neighbor will increase recovery time by 7 days.
    • For example, at Time t=9, Alice recovery time is 14+7 (since John next to her).
    • Assume at Time t=10, Alice has another sick neighbor, her recover time will be: (21-1)+7
  • A sick person should be moved to ICU, only if:
    • The recovery time is more than 28 days
      • For example, at time T=10, Alice recovery time is 27 days, she will not sent to ICU
      • For another example, at time T=11, Alice has another sick neighbor, her recovery time becomes (27-1)+7, she will be sent to ICU at t=11 (if none in the ICU yet)
    • There does have some rooms in ICU
    • Once the people are moved to ICU, he/she will be there till the end
      • For example, Alice will become the survivor till the end but will stay in ICU forever.
  • When sick people successively surrounded by more than three other sick people for more than 7 days will die.
    • When a person die, the cell becomes empty and blocked.
  • Your job is to print:
    • The survivor rate in the end
    • The names of survivors (who are not in ICU)

Input

You will receive several lines.
First line includes 4 numbers: #row, #column, ICU capacity, and output time, respectively.
Second line has an number, which means the number of people inserted during the simulation time.
And following line will write in the format: inserted time, inserted row, inserted column, person name, state.

Output

First line prints out the survivor rate in the end. (round to second decimal place
Second line prints out the names of survivors(who are not in ICU)
( After the last name was print, there will be no space and "\n".

Sample Input  Download

Sample Output  Download

Tags

qq #MadeToMakeYouCry #PainAndDespair #TheCursedAssignment #OJ_runs_on_tears threaten liver Difficult #DataStructureVirus #MakeYouLivingInHell Wanttodie Want_to_die ThisHwIsDeadlierThan #TypicalPM #deadlier that covid NoVaccine Only_One_More_Accept Almost_is_not_Enough you_can_do_it TAwtf who_said_i_can_do_it Mind Reading wryyyyyy i_have_no_idea kll_me_please #not_good #Not good for my eye sukablyat presentation error if_i_kill_myself_it_ _will_be_fault_of_ _this_quiz fuck no_i_cant



Discuss