結果

問題 No.3042 拡大コピー
ユーザー GOTKAKO
提出日時 2025-03-01 02:41:14
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 363 ms / 2,000 ms
コード長 698 bytes
コンパイル時間 1,839 ms
コンパイル使用メモリ 198,924 KB
実行使用メモリ 10,732 KB
最終ジャッジ日時 2025-03-01 07:42:34
合計ジャッジ時間 3,794 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int N; cin >> N;
    vector<pair<long double,long double>> XY(N);
    long double dist1 = -1,sx = 0,sy = 0,dist2 = 0;
    for(auto &[x,y] : XY){
        cin >> x >> y;
        sx += x; sy += y;
    }
    sx /= N; sy /= N;
    for(auto [x,y] : XY) dist1 = max(dist1,sqrtl((x-sx)*(x-sx)+(y-sy)*(y-sy)));
    
    sx = 0,sy = 0;
    for(auto &[x,y] : XY){
        cin >> x >> y;
        sx += x; sy += y;
    }
    sx /= N; sy /= N;
    for(auto [x,y] : XY) dist2 = max(dist2,sqrtl((x-sx)*(x-sx)+(y-sy)*(y-sy)));

    cout << fixed << setprecision(20) << dist2/dist1 << endl;
}
0