結果
問題 | No.813 ユキちゃんの冒険 |
ユーザー |
|
提出日時 | 2020-03-07 04:17:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 233 bytes |
コンパイル時間 | 500 ms |
コンパイル使用メモリ | 70,376 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-21 08:33:36 |
合計ジャッジ時間 | 1,236 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream> #include<iomanip> using namespace std; int N; double p,q; main() { cin>>N>>p>>q; double now=p; for(int i=N-1;i--;) { now=p+(now*p>1-1e-10?0:q*q*now/(1-now*p)); } cout<<fixed<<setprecision(15)<<now<<endl; }