1. 首页
  2. 编程语言
  3. Python
  4. Block Virus

Block Virus

上传者: 2018-12-28 00:10:20上传 PY文件 1.97KB 热度 66次
A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls. The world is modeled as a 2-D array of cells, where 0 represents uninfected cells, and 1 represents cells contaminated with the virus. A wall (and only one wall) can be installed between any two 4-directionally adjacent cells, on the shared boundary. Every night, the virus spreads to all neighboring cells in all four directions unless blocked by a wall. Resources are limited. Each day, you can install walls around only one region -- the affected area (continuous block of infected cells) that threatens the most uninfected cells the following night. There will never be a tie. -- the affected area (continuous block of infected cells) that threatens the most uninfected cells the following night. There will never be a tie.
用户评论