結果
問題 | No.2461 一点張り |
ユーザー |
![]() |
提出日時 | 2023-09-08 21:29:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 344 bytes |
コンパイル時間 | 1,807 ms |
コンパイル使用メモリ | 192,024 KB |
最終ジャッジ日時 | 2025-02-16 19:35:32 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for (int i = 0; i < t; i++) { double p; int k; cin >> p >> k; double ans = 0; double tmp = 1; for (int j = 1; j < k; j++) { ans += j * tmp * p; tmp *= (1 - p); } ans += tmp * k; cout << fixed << setprecision(15); cout << ans << endl; } }