結果
問題 |
No.2235 Line Up Colored Balls
|
ユーザー |
|
提出日時 | 2023-02-21 13:48:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 385 bytes |
コンパイル時間 | 1,533 ms |
コンパイル使用メモリ | 170,320 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-22 07:18:45 |
合計ジャッジ時間 | 3,465 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 55 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<ll> x(n); for(auto &v : x) cin >> v; ll s = accumulate(x.begin(), x.end(), 0ll), s1 = 0; for(auto &v : x) s1 += (s - v) * v; cout << fixed << setprecision(15) << (1 + double(s1) / s) << '\n'; }