We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 911d0e3 commit 3b4783aCopy full SHA for 3b4783a
Codeshef/DEVPERF.cpp
@@ -0,0 +1,42 @@
1
+#include<bits/stdc++.h>
2
+using namespace std;
3
+char A[1001][1001];
4
+int main()
5
+{
6
+ int t;
7
+ scanf("%d",&t);
8
+ while(t--)
9
+ {
10
+ char A[1001][1001];
11
+ int min_col=1011,min_row=1011,max_row=0,max_col=0;
12
+ int n,m;
13
+ scanf("%d %d",&n,&m);
14
+ int i,j;
15
+ int c=0;
16
+ for(i=1;i<=n;i++)
17
18
+ scanf("%s",A[i]);
19
+ for(j=0;j<m;j++)
20
21
+ if(A[i][j]=='*')
22
23
+ min_col=min(min_col,j);
24
+ min_row=min(min_row,i);
25
+ max_col=max(max_col,j);
26
+ max_row=max(max_row,i);
27
+ c++;
28
+ }
29
30
31
+ int max_value=max(max_col-min_col+1,max_row-min_row+1);
32
+ if(c==0)
33
34
+ printf("0\n");
35
36
+ else
37
38
+ printf("%d\n",(max_value/2)+1);
39
40
41
+ return 0;
42
+}
0 commit comments