-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC_Target_Practice.cpp
48 lines (46 loc) · 1.11 KB
/
C_Target_Practice.cpp
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define fr(i, a, b) for (int i = a; i < b; i++)
int main()
{
int t;
cin >> t;
while (t--)
{
vector<vector<char>> v(11,vector<char>(11));
for(int i=1;i<=10;i++){
for(int j=1;j<=10;j++){
cin>>v[i][j];
}
}
long long ans=0;
int arr[10]={1,2,3,4,5,6,7,8,9,10};
for(int i=1;i<=10;i++){
for(int j=1;j<=10;j++){
if(v[i][j]=='X'){
if(i<=5 && j<=5){
ans+=min(i,j);
}
else if(i<=5 && j>=5){
ans+=min(i,11-j);
}
else if(i>=5 && j<=5){
ans+=min(11-i,j);
}
else{
ans+=min(11-i,11-j);
}
}
}
}
cout<<ans<<endl;
}
return 0;
}