#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int x;
int _i, _j;
bool isOne = false;
for (int i = 1; i <= 5; i++){
for (int j = 1; j <= 5; j++){
cin >> x;
if (x)
{
_i = i;
_j = j;
}
}
}
cout << abs(_i - 3) + abs(_j - 3) << endl;
return 0;
}
CodeForces-263A-Beautiful Matrix
最新推荐文章于 2020-12-03 12:31:56 发布