#include <iostream>
#include <vector>
using namespace std;
void SetZeroes(vector<vector<int> > &matrix)
{
if (matrix.size() <= 0)return;
int row = matrix.size();
int col = matrix[0].size();
bool setFirstRowZero = false;
bool setFirstColZero = false;
for (int j = 0; j < col; ++j)
if (matrix[0][j] == 0)
{
setFirstRowZero = true;
break;
}
for (int i = 0; i < row; ++i)
if (matrix[i][0] == 0)
{
setFirstColZero = true;
break;
}
for (int i = 1; i < row; ++i)
for (int j = 1; j < col; ++j)
{
if (matrix[i][j] == 0)
{
matrix[0][j] = 0;
matrix[i][0] = 0;
}
}
for (int i = 1; i < row; ++i)
for (int j = 1; j < col; ++j)
if (matrix[i][0] == 0 || matrix[0][j] == 0)
matrix[i][j] = 0;
if (setFirstRowZero)
for (int j = 0; j < col; ++j)
matrix[0][j] = 0;
if (setFirstColZero)
for (int i = 0; i < row; ++i)
matrix[i][0] = 0;
}
int main(int argc, char** argv)
{
return 0;
}