結果
| 問題 |
No.3042 拡大コピー
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-28 22:24:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 382 ms / 2,000 ms |
| コード長 | 907 bytes |
| コンパイル時間 | 2,068 ms |
| コンパイル使用メモリ | 198,672 KB |
| 実行使用メモリ | 10,740 KB |
| 最終ジャッジ日時 | 2025-03-01 07:39:11 |
| 合計ジャッジ時間 | 4,121 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<pair<double,double>> a(n), b(n);
long double X0 = 0, Y0 = 0, X1 = 0, Y1 = 0;
long double sx0 = 0, sy0 = 0, sx1 = 0, sy1 = 0;
for(auto &&[x, y] : a){
cin >> x >> y;
X0 += x, Y0 += y;
}
for(auto &&[x, y] : b){
cin >> x >> y;
X1 += x, Y1 += y;
}
long double s0 = 0, s1 = 0;
for(auto &&[x, y] : a){
long double dx = (ll)(n) * x - X0;
long double dy = (ll)(n) * y - Y0;
s0 = max(s0, dx * dx + dy * dy);
}
for(auto &&[x, y] : b){
long double dx = (ll)(n) * x - X1;
long double dy = (ll)(n) * y - Y1;
s1 = max(s1, dx * dx + dy * dy);
}
cout << fixed << setprecision(15) << (double)sqrtl((long double)(s1) / s0) << '\n';
}