結果
問題 |
No.3042 拡大コピー
|
ユーザー |
![]() |
提出日時 | 2025-03-01 08:05:21 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 885 ms / 2,000 ms |
コード長 | 1,126 bytes |
コンパイル時間 | 3,376 ms |
コンパイル使用メモリ | 276,872 KB |
実行使用メモリ | 7,168 KB |
最終ジャッジ日時 | 2025-03-01 08:05:28 |
合計ジャッジ時間 | 6,790 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<(int)n; i++) #define repi(i,m,n) for(int i=(int)m; i<=(int)n; i++) #define rrep(i,n) for(int i=(int)n-1; i>=0; i--) #define rrepi(i,m,n) for(int i=(int)n; i>=(int)m; i--) #define all(x) x.begin(),x.end() template <typename T> inline bool chmin(T& a, const T& b) { return a > b ? a = b, true : false; }; template <typename T> inline bool chmax(T& a, const T& b) { return a < b ? a = b, true : false; }; template <typename T> void uniq(std::vector<T> &v){ std::sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end()); } using ll = long long; int main(){ int n; cin >> n; vector<double> x(n),y(n); double sx = 0,sy = 0,tx = 0,ty = 0,sd = 0,td = 0; rep(i,n){ cin >> x[i] >> y[i]; sx += x[i]; sy += y[i]; } sx /= n; sy /= n; rep(i,n) sd += hypot(x[i]-sx,y[i]-sy); rep(i,n){ cin >> x[i] >> y[i]; tx += x[i]; ty += y[i]; } tx /= n; ty /= n; rep(i,n) td += hypot(x[i]-tx,y[i]-ty); cout << fixed << setprecision(15) << td/sd << endl; return 0; }