結果

問題 No.2009 Drunkers' Contest
ユーザー Carpenters-CatCarpenters-Cat
提出日時 2022-07-15 21:45:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 454 bytes
コンパイル時間 1,816 ms
コンパイル使用メモリ 196,488 KB
最終ジャッジ日時 2025-01-30 07:37:18
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 7 WA * 47
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using P = pair<double, double>;
int main () {
    int N;
    cin >> N;
    vector<P> A(N);
    for (auto& [a, b] : A) {
        cin >> a;
    }
    for (auto& [a, b] : A) {
        cin >> b;
    }
    double ans = 0;
    for (auto [a, b] : A) {
        if (a <= b) {
            ans += a + b;
        } else {
            ans += 2 * sqrt(a * b);
        }
    }
    cout << setprecision(20) << ans << endl;
}
0