結果

問題 No.1993 Horse Racing
ユーザー shoshoshom
提出日時 2022-07-01 21:45:29
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 637 bytes
コンパイル時間 2,125 ms
コンパイル使用メモリ 194,900 KB
最終ジャッジ日時 2025-01-30 02:40:59
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

static inline void solve() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  vector<double> V(n - 1);
  for (int i = 0; i < n - 1; i++) {
    V[i] = double(1000 - A[i]) / (double) 1000.0;
  }
  long double v = 1.0;
  for (double dv: V) {
    v *= dv;
  }
  double ans = 1000.0 - 1000.0 * v;
  printf("%.10lf", ans);
}

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
#ifdef LOCAL
  int T;
  cin >> T;
  for (int tc = 1; tc <= T; tc++) {
    cout << "Case" << tc << ":" << '\n';
    solve();
  }
#else
  solve();
#endif
  return 0;
}
0