結果
| 問題 | No.813 ユキちゃんの冒険 |
| コンテスト | |
| ユーザー |
C
|
| 提出日時 | 2026-10-14 22:08:36 |
| 言語 | C++23(gcc16) (gcc 16.2.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 2 ms / 2,000 ms |
| + 85µs | |
| コード長 | 872 bytes |
| 記録 | |
| コンパイル時間 | 8,640 ms |
| コンパイル使用メモリ | 388,952 KB |
| 実行使用メモリ | 9,908 KB |
| 最終ジャッジ日時 | 2026-10-14 22:08:47 |
| 合計ジャッジ時間 | 9,855 ms |
|
ジャッジサーバーID (参考情報) |
judge6_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
#include <boost/polygon/point_data.hpp>
#include <boost/polygon/voronoi.hpp>
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(x) begin(x),end(x)
#define sz(x) (int)(x).size()
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
using vll=vector<ll>;
using vvll=vector<vll>;
using vi=vector<int>;
using vvi=vector<vi>;
using pll=pair<ll,ll>;
using pi=pair<int,int>;
// using mint=modint998244353;
// using BoostPoint=boost::polygon::point_data<int>;
// using Voronoi=boost::polygon::voronoi_diagram<double>;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
ld p,q;
cin>>N>>p>>q;
if(p==1){
cout<<1<<'\n';
return 0;
}
ld a=0;
rep(i,0,N)a=p+(q*q*a)/(1-p*a);
cout<<fixed<<setprecision(20)<<a<<'\n';
}
C