Submission

Status:
P---P-----

Score: 20

User: meme_boi2

Problemset: A.Circle Area

Language: cpp

Time: 0.002 second

Submitted On: 2024-11-12 22:29:23

//Circle Array
#include <bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(0);cin.tie(0);
	int m, n;
	cin >> m >> n;
	bool mat[m][n];
	for(int i = 0; i < m; i++){
		string txt; cin >> txt;
		for(int j = 0; j < n; j++){
			if(txt[j] == '#') mat[i][j] = 1;
			else mat[i][j] = 0;
		}
	}
	int rmax = -1;
	double rad;
	for(int i = 0; i < m; i++){
		double cnt = 0;
		for(int j = 0; j < n; j++){
			if(mat[i][j]) cnt++;
		}
		if(cnt > rmax){
			rmax = i;
			rad = cnt/2;
		}
	}
	//cout << rad << '\n';
	int st, end;
	for(int j = 0; j < n; j++){
		if(mat[rmax][j] && !mat[rmax][j-1] && j != 0) st = j;
		else if(mat[rmax][j] && !mat[rmax][j+1] && j != n-1) end = j;
	}
	cout << rmax + 1 << ' ' << (st+end)/2 + 1 << '\n' << fixed << setprecision(2) << 3.14*rad*rad;
}