Skip to content

Commit 7643459

Browse files
committed
263A - Beautiful Matrix.cpp
1 parent 992e3fe commit 7643459

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

263A - Beautiful Matrix.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
// Code Written By: Vikash Patel
5+
6+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
7+
8+
int main()
9+
{
10+
int mat[5][5];
11+
int m,n;
12+
for(int i=0;i<5;i++)
13+
{
14+
for(int j=0;j<5;j++)
15+
{
16+
cin>>mat[i][j];
17+
if(mat[i][j]==1)
18+
{
19+
m=i+1;
20+
n=j+1;
21+
}
22+
}
23+
}
24+
cout<<abs(m-3)+abs(n-3)<<endl;
25+
}

0 commit comments

Comments
 (0)