結果

問題 No.3042 拡大コピー
ユーザー kotatsugame
提出日時 2025-02-28 21:50:53
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 383 ms / 2,000 ms
コード長 701 bytes
コンパイル時間 839 ms
コンパイル使用メモリ 72,392 KB
実行使用メモリ 8,112 KB
最終ジャッジ日時 2025-03-01 07:38:12
合計ジャッジ時間 2,718 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<iomanip>
#include<cmath>
#include<cassert>
using namespace std;
int N;
pair<double,double>Q[10000000];
long double rd()
{
	pair<double,double>sum=make_pair(0,0);
	for(int i=0;i<N;i++)
	{
		pair<double,double>q;
		cin>>q.first>>q.second;
		sum.first+=q.first;
		sum.second+=q.second;
		Q[i]=q;
	}
	sum.first/=N;
	sum.second/=N;
	long double ret=0;
	for(int i=0;i<N;i++)ret+=hypot(sum.first-Q[i].first,sum.second-Q[i].second);
	return ret;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin>>N;
	auto x=rd();
	auto y=rd();
	//cout<<fixed<<setprecision(16)<<hypot(y.first,y.second)/hypot(x.first,x.second)<<endl;
	cout<<fixed<<setprecision(16)<<y/x<<endl;
}
0