結果
問題 | No.1076 寿司打 |
ユーザー |
![]() |
提出日時 | 2020-06-12 21:25:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,026 ms / 2,000 ms |
コード長 | 593 bytes |
コンパイル時間 | 1,837 ms |
コンパイル使用メモリ | 192,320 KB |
最終ジャッジ日時 | 2025-01-11 02:08:36 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <bits/stdc++.h> using namespace std; template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;} using Int = long long; const char newl = '\n'; struct Precision{ Precision(){ cout<<fixed<<setprecision(12); } }precision_beet; //INSERT ABOVE HERE signed main(){ cin.tie(0); ios::sync_with_stdio(0); using D = double; D p; cin>>p; D ans=0; const int MAX = 1e7; D res=1-p; for(int i=0;i<MAX;i++){ ans+=i*res; res*=p; } cout<<ans<<endl; return 0; }