結果
| 問題 | No.2461 一点張り |
| コンテスト | |
| ユーザー |
shobonvip
|
| 提出日時 | 2023-09-08 22:08:36 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 329 bytes |
| 記録 | |
| コンパイル時間 | 1,226 ms |
| コンパイル使用メモリ | 208,860 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-02 09:46:08 |
| 合計ジャッジ時間 | 1,974 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
void solve(){
double p; cin >> p;
int k; cin >> k;
double now = 1;
double ans = 0;
for(int i=1; i<k; i++){
ans += now * p * i;
now *= 1 - p;
}
ans += now * k;
cout << fixed << setprecision(15);
cout << ans << '\n';
}
int main(){
int t; cin >> t;
while(t--) solve();
}
shobonvip