結果

問題 No.2009 Drunkers' Contest
ユーザー keisuke6keisuke6
提出日時 2022-07-15 22:12:34
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 3,014 ms
コンパイル使用メモリ 246,092 KB
実行使用メモリ 6,404 KB
最終ジャッジ日時 2023-09-10 02:17:06
合計ジャッジ時間 10,111 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 3 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 154 ms
6,208 KB
testcase_26 AC 153 ms
6,404 KB
testcase_27 AC 152 ms
6,240 KB
testcase_28 AC 152 ms
6,160 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 153 ms
6,324 KB
testcase_32 AC 153 ms
6,192 KB
testcase_33 AC 154 ms
6,156 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 165 ms
6,220 KB
testcase_45 AC 165 ms
6,112 KB
testcase_46 AC 112 ms
6,380 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int N;
  cin>>N;
  vector<int> A(N),B(N);
  double a=0,b=0;
  for(int i=0;i<N;i++){
      cin>>A[i];
      a += A[i];
  }
  for(int i=0;i<N;i++){
      cin>>B[i];
      b += B[i];
  }
  double aa=a,bb=b;
  double ans = 0;
  double now = 1;
  for(int i=0;i<N;i++){
      if(sqrt(aa*bb) < aa && bb < sqrt(aa*bb) && A[i]/now > B[i]*now){
          now = max(now,aa/sqrt(aa*bb));
      }
      ans += A[i]/now;
      ans += B[i]*now;
      a -= A[i];
      b -= B[i];
      aa = a/now;
      bb = b*now;
  }
  cout<<fixed<<setprecision(12);
  cout<<ans<<endl;
}
0