-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathA.cpp
More file actions
33 lines (26 loc) · 679 Bytes
/
A.cpp
File metadata and controls
33 lines (26 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int pos_x, pos_y;
for (int i = 0; i < 5; ++i) {
for (int j = 0; j < 5; ++j) {
int input;
cin >> input;
if (input == 1) {
pos_x = i;
pos_y = j;
}
}
}
pos_x += 1;
pos_y += 1;
int output =
( pos_x-3>0?pos_x-3:3-pos_x )
+
(pos_y-3>0?pos_y-3:3-pos_y )
;
cout<<output;
return 0;
}