본문 바로가기
백준 문제 해설

백준 24751 Betting

by toomanysegtrees 2022. 11. 8.

 피곤하다

https://www.acmicpc.net/problem/24751

 

24751번: Betting

For each option (option one, then option two), display the number x such that 1:x is the switch-payout-ratio for that option. Your answer should have an absolute or relative error of at most $10^{-3}$.

www.acmicpc.net

풀이

문제에서 주어지는 수식을 상대오차에 맞게 출력해준다

 

시간 복잡도 : $O(1)$

소요 시간 : 1분

아쉬운 점 : 없다

전체적인 감상 : 없다

/* basic setup {{{ */
#include<bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define sz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define compress(x) sort(all(x)), x.erase(unique(all(x)), x.end())
#define fast_io ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef const int ci;
const int MOD = 1e9+7;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
/*}}}*/

int main(){
	double a;
	cin>>a;
	cout<<fixed;
	cout.precision(10);
	cout<<100/a<<'\n'<<100/(100-a);
}

'백준 문제 해설' 카테고리의 다른 글

백준 3056 007  (0) 2022.11.11
백준 19851 버거운 버거  (0) 2022.11.10
백준 1731 추론  (0) 2022.11.09
백준 4179 불!  (0) 2022.11.08
백준 15749 Snow Boots  (0) 2022.11.06
백준 25704 출석 이벤트  (0) 2022.11.05
백준 18409 母音を数える (Counting Vowels)  (0) 2022.11.04
백준 4589 Gnome Sequencing  (0) 2022.11.03