結果
問題 |
No.3042 拡大コピー
|
ユーザー |
|
提出日時 | 2025-02-28 22:22:13 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 874 bytes |
コンパイル時間 | 2,193 ms |
コンパイル使用メモリ | 197,452 KB |
実行使用メモリ | 10,756 KB |
最終ジャッジ日時 | 2025-03-01 07:39:05 |
合計ジャッジ時間 | 3,016 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 24 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:21:19: warning: overflow in conversion from ‘double’ to ‘__int128’ changes value from ‘1.0e+100’ to ‘0x7fffffffffffffffffffffffffffffff’ [-Woverflow] 21 | __int128 s0 = 1e100, s1 = 1e100; | ^~~~~ main.cpp:21:31: warning: overflow in conversion from ‘double’ to ‘__int128’ changes value from ‘1.0e+100’ to ‘0x7fffffffffffffffffffffffffffffff’ [-Woverflow] 21 | __int128 s0 = 1e100, s1 = 1e100; | ^~~~~
ソースコード
#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<ll,ll>> a(n), b(n); ll X0 = 0, Y0 = 0, X1 = 0, Y1 = 0; ll 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; } __int128 s0 = 1e100, s1 = 1e100; for(auto &&[x, y] : a){ __int128 dx = (ll)(n) * x - X0; __int128 dy = (ll)(n) * y - Y0; s0 = min(s0, dx * dx + dy * dy); } for(auto &&[x, y] : b){ __int128 dx = (ll)(n) * x - X1; __int128 dy = (ll)(n) * y - Y1; s1 = min(s1, dx * dx + dy * dy); } cout << fixed << setprecision(15) << (double)sqrtl((long double)(s1) / s0) << '\n'; }