Submission

Status:
PP-PPPPP--

Score: 70

User: Nathlol2

Problemset: A.Circle Area

Language: cpp

Time: 0.003 second

Submitted On: 2025-01-06 10:45:55

#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const double pi = 3.14;
int32_t main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n, m;
    cin >> n >> m;
    string a[n];
    for(int i = 0;i<n;i++){
        cin >> a[i];
    }
    pair<int, int> ans = {0, 0};
    double mx = 0;
    double l = 0;
    double rad;
    for(int i = 0;i<n;i++){
        l = 0;
        int s = 0, e = 0;
        for(int j = 0;j<m;j++){
            if(a[i][j] == '#'){
                if(a[i][j - 1] == '.'){
                    s = j;
                }
                if(a[i][j + 1] == '.'){
                    e = j;
                }
                l++;
            }
        }
        if(l > mx){
            ans.first = i + 1;
            ans.second = (s + e) / 2 + 1;
        }
        mx = max(mx, l);
    }
    rad = mx / 2;
    cout << ans.first << " " << ans.second << '\n';
    cout << setprecision(4) << rad * rad * pi;
}