結果
| 問題 |
No.2235 Line Up Colored Balls
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-21 13:27:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 461 bytes |
| コンパイル時間 | 1,548 ms |
| コンパイル使用メモリ | 167,060 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-22 07:18:41 |
| 合計ジャッジ時間 | 3,505 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
assert(1 <= n && n <= 100000);
ll s0 = 0, s1 = 0, v;
for(int i = 0; i < n; i++){
cin >> v;
assert(1 <= v);
s0 += v;
s1 += v * v;
}
assert(s0 <= 1000000000);
cout << fixed << setprecision(15) << (s0 + 1 - (double)(s1) / (s0) - 1e-6) << '\n';
}