text
stringlengths
49
983k
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a);i<(ut)(b);i++) #define REP(i,b) FOR(i,0,b) #define ALL(c) c.begin(),c.end() #define PB push_back #define cat //cout << __LINE__ << endl; using namespace std; typedef long long LL; typedef double ld; typedef int ut; typedef vector<ut> VI; typedef pair<ut,ut> pr; ...
#include "iostream" #include "iomanip" using namespace std; long double X; long double rad; long double ans; int main() { cin >> X >> rad; if ((long long int)X % 2 == 0) { for (int i = 0; i < 10000000; i++) { ans = (ans + X - rad / 100 * ans + (100.0 - rad) / 100 * ans) / 2; } } else { for (int i = 0; i ...
#include <iostream> #include <iomanip> #include <cstdio> #include <string> #include <cstring> #include <deque> #include <list> #include <queue> #include <stack> #include <vector> #include <utility> #include <algorithm> #include <map> #include <set> #include <complex> #include <cmath> #include <limits> #include <climits...
#include <bits/stdc++.h> #define ADD(a, b) a = (a + ll(b)) % mod #define MUL(a, b) a = (a * ll(b)) % mod #define MAX(a, b) a = max(a, b) #define MIN(a, b) a = min(a, b) #define rep(i, a, b) for(int i = int(a); i < int(b); i++) #define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--) #define all(a) (a).begin(), (a...
#include <bits/stdc++.h> #define _overload(_1,_2,_3,name,...) name #define _rep(i,n) _range(i,0,n) #define _range(i,a,b) for(int i=int(a);i<int(b);++i) #define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__) #define _rrep(i,n) _rrange(i,n,0) #define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i) #define r...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) //const ll mod = 1000000007; long double f(int x, long double p) { if(x % 2 == 1){ return p * f(x - 1, p) + (1 - p) * f(x + 1, p) + 1; } return (x / 2) * (1 / p); } int m...
/** * author: tourist * created: 26.11.2019 09:30:33 **/ #include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int x; cin >> x; double p; cin >> p; p *= 0.01; if (x % 2 == 1) { cout << fixed << setprecision(17) << (x + 1) / 2 / p << '\n...
#include <cstdio> int main() { long long x; int p; scanf("%lld%d",&x,&p); printf("%lf\n",(x+1)/2*(double)100./p); return 0; }
#include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> using namespace std; typedef long long ll; typedef unsigned i...
#include<iostream> #include<fstream> #include<algorithm> #include<vector> #include<queue> #include<map> #include<set> #include<string> #include<cmath> using namespace std; #define REP(i,m,n) for(int i=(m); i<(int)(n); i++) #define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--) #define rep(i,n) REP(i,0,n) #define rrep(i,...
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0;i<(int)(n);i++) #define ALL(x) (x).begin(), (x).end() typedef long long ll; typedef long double ld; const int INF = 1e9; const ld EPS = 1e-8; int main(){ int x, p; cin >> x >> p; long double res = ((x + 1) / 2) / (p / 100.0); cout <<...
#include<bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false), cin.tie(0); int x, pp; cin >> x >> pp; double p = pp / 100.0; double ans; if(x % 2) { ans = 1 + (1 / p) * (x / 2) + (1 / p) * (1 - p); } else { ans = (1 / p) * (x / 2); } cout << fixed <...
#include <algorithm> #include <cassert> #include <cctype> #include <cstdlib> #include <cmath> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <string> #include <unordered_map> #include <unordered...
#include <bits/stdc++.h> using namespace std; #define DEBUG_MODE #define endl '\n' #ifdef DEBUG_MODE #define DEBUG(...) debug_func_mult(split_names(#__VA_ARGS__), __VA_ARGS__) #define DEBUG_ENDL endl << flush #define DEBUG_SEPARATOR_LINE cout<<"=================\n" #else #define DEBUG(...) 0 #define DEBUG_ENDL 0 #defin...
#pragma region include #include <iostream> #include <iomanip> #include <stdio.h> #include <sstream> #include <algorithm> #include <iterator> #include <cmath> #include <complex> #include <string> #include <cstring> #include <vector> #include <tuple> #include <bitset> #include <queue> #include <complex> #include <set>...
#include <bits/stdc++.h> using namespace std; double f(int p, int n) { double P = p/100.0; double Q = 1.0 - P; double ans = (-n)/(2*(Q-1)); return ans; } int main() { int x,p; cin>>x>>p; cout.precision(10); double ans; if(x%2) ans = 1.0 + (p/100.0)*f(p,x-1) + ((100 - p)/100.0)*f(p,x+1); else ans = f(p,x);...
#ifndef KOMAKI_LOCAL #define NDEBUG #endif #include <bits/stdc++.h> #include <sys/time.h> #include <unistd.h> using namespace std; #define i64 int64_t #define rep(i, n) for(i64 i = 0; i < ((i64)(n)); ++i) #define sz(v) ((i64)((v).size())) #define bit(n) (((i64)1)<<((i64)(n))) #define all(v) (...
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <deque> #include <map> #include <set> #include <cassert> using namespace std; #define rep(i,a,n) for (int i=a;i<n;i++) #define per(i,a,n) for (int i=n-1;i>=a;i--) #define pb push_b...
#include <stdio.h> #include <algorithm> #include <assert.h> #include <bitset> #include <cmath> #include <complex> #include <deque> #include <functional> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <stdlib.h> #include <string...
#include <bits/stdc++.h> using namespace std; double x, p; int main() { cin >> x >> p; double res = floor((x + 1) / 2) / (p / 100); printf("%.8f", res); }
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> P; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; // #define int long long #define pb push_back #define mp make_pair #define eps 1e-9 #define INF 2000000000 #define LLINF 10000000000000ll #define fi first #define sec second #d...
#include <iostream> #include <iomanip> using namespace std; double p; int x; int main(){ cin >> x >> p; p /= 100; if(x%2==1) x++; cout << setprecision(8) << x/(2*p) << endl; }
#include <bits/stdc++.h> typedef long long i64; using std::cout; using std::endl; using std::cin; int main() { int x, p; cin >> x >> p; cout << std::fixed << std::setprecision(10); cout << (double)((x + 1) / 2) / (p / 100.) << endl; return 0; }
#include <iostream> #include <iomanip> // << fixed << setprecision(xxx) #include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ; #include <vector> #include <string> // to_string(nnn) // substr(m, n) // stoi(nnn) #include <complex> #include <tuple> // get<n>(xxx) #include <queue> #include <stack> #include <...
#include <bits/stdc++.h> using namespace std; typedef long long LL; int main(){ LL x, p1; cin >> x >> p1; double p = ((double)p1) / 100.0; if(x % 2) x++; x /= 2; double r = ((double)x)/p; printf("%.9lf\n", r); }
#include<iostream> #include<cstdio> #include<algorithm> #include<set> #include<map> #include<queue> #include<cassert> #include<iomanip> #define PB push_back #define MP make_pair #define sz(v) (in((v).size())) #define forn(i,n) for(in i=0;i<(n);++i) #define forv(i,v) forn(i,sz(v)) #define fors(i,s) for(auto i=(s).begin(...
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <sstream> #include <map> #include <set> #include <queue> #include <algorithm> #include <cmath> #include <cstring> #include <typeinfo> #include <numeric> #include <functional> #include <unordered_map> #include <bitset> #include <stack> #i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define all(x) (x).begin(),(x).end() const int mod=1000000007,MAX=4003,INF=1<<30; int main(){ long double X,P;cin>>X>>P; if(int(X)%2==0){ cout<<setprecision(25)<<100.0/P*(X/2.0)<<endl; }else{ cout<<setprecision(25...
#include <cstdio> int x, p; int main() { scanf("%d %d", &x, &p); printf("%.12lf\n", 50.0 * (x + x % 2) / p); return 0; }
#include <iostream> #include <iomanip> using namespace std; int main(){ int x, p; cin >> x >> p; double ans; if(x%2 == 0){ ans = ((double)(x/2))*((double)(100)/(double)(p)); }else{ ans = ((double)((x+1)/2))*((double)(100)/(double)(p)); } cout << fixed; cout << setprecis...
#include <iostream> #include <cstdio> #include <cmath> #include <ctime> #include <cstdlib> #include <cassert> #include <vector> #include <list> #include <stack> #include <queue> #include <deque> #include <map> #include <set> #include <bitset> #include <string> #include <algorithm> #include <utility> #define llint long ...
#include<bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<double> vd; typedef vector<vd> vvd; typedef vector<vvd> vvvd; typedef pair<int, int> pii; typedef vector<pii> vpii; #define pb push_back #define mp make_pair #define snd second #define fst first #define debug ...
#include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) double rec(int x, double p) { if (x % 2) return p * rec(x - 1, p) + (1 - p) * rec(x + 1, p) + 1; return x / p / 2; } //----------------------------------------------------------------- int main() { int x, p; cin >> x >> p; ...
#include <cstdio> #include <cstring> #include <string> #include <iostream> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <unordered_map> using namespace std; typedef long long int ll; typedef pair<int, int> P; int main...
#define _CRT_SECURE_NO_WARNINGS #include <iostream> #include <iomanip> #include <stdio.h> #include <algorithm> #include <math.h> #include <numeric> #include <iterator> #include <fstream> #include <math.h> #include <random> #include <vector> #include <string> #include <stack> #include <set> #include <map> #include <deq...
#include <iostream> #include <stdio.h> using namespace std; int x; double p; int main(void) { cin >> x >> p; p /= 100; double ans; if(x % 2 == 0){ ans = x/2/p; } else{ ans = p*(x-1)/2/p + (1-p)*(x+1)/2/p + 1; } printf("%.11f\n", ans); return 0; }
#include<bits/stdc++.h> using namespace std; using Int = long long; struct Precision{ Precision(){ cout<<fixed<<setprecision(12); } }precision_beet; //INSERT ABOVE HERE signed main(){ int x; double p; cin>>x>>p; p/=100; double ans=(x&1); if(x&1){ ans+=p*(1/p)*(x-1)/2; ans+=(1.-p)*(1/p)*(x+...
#include <vector> #include <iostream> #include <algorithm> #include <utility> #include <set> #include <map> #include <cmath> #include <iomanip> using namespace std; template<typename T, typename S> istream& operator >> (istream& is, pair<T, S>& p) { is >> p.first >> p.second; return is; } template<typename T...
//xが偶数のとき, 移動方法が定まる(右に移動すればいい)ので簡単. //xが奇数のとき, 1ターン止まったあと, xが偶数のパターンになる。 //x-1, x+1どちらになっても(最適な)動き方は同じ・不完全情報ゲームより(?)、止まるタイミングは最初にして良いので簡単。 #include <iostream> #include <cstdio> using namespace std; int main() { int x, p; cin >> x >> p; double P = p * 0.01; if (x % 2 == 0) { printf("%.14f\n", x / (2 * P)); } ...
#include <bits/stdc++.h> #include <sys/time.h> using namespace std; #define rep(i,n) for(long long i = 0; i < (long long)(n); i++) #define repi(i,a,b) for(long long i = (long long)(a); i < (long long)(b); i++) #define pb push_back #define all(x) (x).begin(), (x).end() #define fi first #define se second #define mt make...
#include<iostream> #include<iomanip> using namespace std; int X; double p; double calc(int x) { return x/2/p; } int main() { cin>>X>>p;p/=100; double ans; if(X%2==0)ans=calc(X); else ans=p*calc(X-1)+(1-p)*calc(X+1)+1; cout<<fixed<<setprecision(16)<<ans<<endl; }
#include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <set> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <sstream> #include <complex> #include <stack> #include <queue> #include <cstdio> #include <cstring> #include <iterator> #include <b...
#include <bits/stdc++.h> #include <assert.h> using namespace std; typedef long long ll; typedef long double ld; #define PB push_back #define MP make_pair #define MOD 1000000007LL #define endl "\n" const ll UNDEF = -1; const ll INF=1e18; template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, tr...
#include <bits/stdc++.h> using namespace std; int main(){ long long X, P; cin >> X >> P; double ans; if(X % 2 == 0) ans = 50.0 * X / P; else ans = 50.0 * (X + 1.0) / P; cout.precision(15); cout << ans << endl; }
#include<map> #include<set> #include<bitset> #include<cstdio> #include<iostream> #include<algorithm> #include<vector> #include<queue> #include<string> #include<chrono> #include<stack> #include<fstream> #include<list> #define REP(i,x,y) for(ll i=x;i<=y;i++) #define SIZE(a) ll(a.size()) #define vll vector<ll> #define ME...
#include<iostream> #include<string> #include<queue> #include<algorithm> #include<map> #include<set> #include<vector> #include<math.h> #include<time.h> using namespace std; #define INF 1000000007 #define LINF (1LL << 62) typedef long long i64; typedef pair<i64,i64> P; i64 n, m; int main(){ cin >> n >> m; print...
#include<bits/stdc++.h> using namespace std; int main(){ long long x,p;cin>>x>>p;x=(x+1)/2*100; cout<<fixed<<setprecision(6)<<x/(double)p<<endl; return 0; }
#include <bits/stdc++.h> using namespace std; double solve(int x, double p) { if(x%2==1) return p*solve(x-1, p)+(1.0-p)*solve(x+1, p)+1.0; x/=2; return x/p; } int main() { int x, p; scanf("%d%d", &x, &p); printf("%.9f\n", solve(x, p/100.0)); return 0; }
#include <cmath> #include <iostream> #include <vector> #include <queue> #include <deque> #include <map> #include <set> #include <stack> #include <tuple> #include <bitset> #include <algorithm> #include <functional> #include <utility> #include <iomanip> #define int long long int #define rep(i, n) for(int i = 0; i < (n);...
#include<bits/stdc++.h> using namespace std; double X; double P; int main() { cin >> X >> P; printf("%lf\n" ,50.0 * (X + ((int)X % 2)) / P); return 0; }
#include <bits/stdc++.h> using namespace std; int main(){ long long x; double p; cin>>x>>p; if(x%2){cout<<setprecision(20)<<(((double)x+1)/2)/p*100<<endl;} else{ cout<<setprecision(20)<<(((double)x)/2)/p*100<<endl;} }
#include <bits/stdc++.h> using namespace std; #define rep(i,x,y) for(int i=(x);i<(y);++i) #define debug(x) #x << "=" << (x) #ifdef DEBUG #define _GLIBCXX_DEBUG #define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl #else #define print(x) #endif const int inf=1e9; const int64_t inf64=1e18; c...
#include <bits/stdc++.h> #define mp make_pair #define eb emplace_back #define ff first #define ss second using namespace std; typedef long long ll; typedef long double ld; #ifdef ONPC mt19937 rnd(228); #else mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); #endif const int MAXN = 100; //#defin...
#include<bits/stdc++.h> using namespace std; typedef long long LL; struct cww{cww(){ ios::sync_with_stdio(false);cin.tie(0); cout<<fixed; cout<<setprecision(10); }}star; #define fin "\n" #define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++) #define REP(i,n) FOR(i,0,n) #define fi first #define se second #define p...
#include<bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) #define pb push_back #define all(v) (v).begin(),(v).end() #define fi first #define se second typedef vector<int>vint; typedef pair<int,int>pint; typedef vector<pint>vpint; template<typename A,typename B>inline ...
#include<iostream> #include<algorithm> #include<vector> #include<queue> #include<iomanip> #define lol(i,n) for(int i=0;i<n;i++) #define mod 1000000007 typedef long long ll; using namespace std; int main(){ ll x,p;cin>>x>>p; cout<<fixed<<setprecision(10)<<(x+1)/2*100/(double)p<<endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(){ int x; double p; cin >> x >> p; p /= 100.0; if(x % 2) { x /= 2; printf("%.9lf\n",x + (x + 1) / p * (1 - p) + 1); } else printf("%.9lf\n",x / 2 / p); return 0; }
#include <bits/stdc++.h> #define all(vec) vec.begin(),vec.end() #define mp make_pair using namespace std; using ll=long long; using P=pair<ll,ll>; const ll INF=1LL<<30; const ll LINF=1LL<<62; const double eps=1e-9; const ll MOD=1000000007LL; template<typename T>void chmin(T &a,T b){a=min(a,b);}; template<typename T>voi...
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define sz(x) (int)((x).size()) #define jonathan ios_base::sync_with_stdio(0) #define livingston cin.tie(0) using namespace std; ...
#include <iostream> #include <iomanip> #include <algorithm> #include <bitset> #include <set> #include <unordered_set> #include <map> #include <unordered_map> #include <cmath> #include <time.h> #include <random> #include <string> #include <cassert> #include <vector> #include <ostream> #include <istream> #include <stack>...
#include <algorithm> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstring> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include...
#include<cstdio> #include<iostream> #include<vector> #include<string> #include<algorithm> #include<queue> #include<stack> #include<map> #include<set> #include<iomanip> #define rep0(i,N) for(int i=0;i<N;i++) #define rep1(i,a,N) for(int i=0+a;i<N;i++) #define lint long long int #define SIZE 100005 using namespace std; ...
// #include {{{ #include <iostream> #include <cassert> #include <cstring> #include <cstdlib> #include <cstdio> #include <cctype> #include <cmath> #include <ctime> #include <queue> #include <set> #include <map> #include <stack> #include <string> #include <bitset> #include <vector> #include <complex> #include <algorithm>...
#include <iostream> #include <vector> #include <string> #include <cmath> #include <algorithm> #include <utility> #include <queue> #include <set> #include <map> #include <deque> #include <iomanip> #include <cstdio> using namespace std; typedef long long ll; typedef pair<int,int> PII; typedef vector<int> VI; typedef ve...
# include "bits/stdc++.h" using namespace std; using LL = long long; using ULL = unsigned long long; const double PI = acos(-1); template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); } template<class T>constexpr T HINF() { return INF<T>() / 2; } template <typename T_char>T_char TL(T_char cX) { re...
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; #define int ll typedef vector<char> vc; typedef vector<vc> vvc; typedef vector<vvc> vvvc; typedef pair<int, int> pii; typedef pair<pii, pii> piii; typedef pair<ll, ll> pll; typ...
#include<bits/stdc++.h> using namespace std; int main(){ long x,p;cin>>x>>p; cout<<fixed<<setprecision(10)<<50.0*(x+x%2)/p; }
#include <iostream> #include <algorithm> #include <vector> #include <iomanip> #include <map> #include <queue> static const int MOD = 1000000007; using ll = long long; using u32 = unsigned; using namespace std; template<class T> constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208; int main() { ll x, p; ...
#include <bits/stdc++.h> using namespace std; int main() { int X, P; cin >> X >> P; int a = (X + 1) / 2; double p = P / 100.0; cout << fixed << setprecision(9) << 1 / p * a << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,a) for(int i=0;i<(a);i++) const ll MOD=1000000007; // 1ターン分プラスして, // dp_x=1+dp_(x-2)*P/100+dp_x*(100-p)/100 // dp_x=dp_(x-2)+100/p int main(){ ll x; cin>>x; double p; cin>>p; if(x%2) x++; cout<<setprecision(15); cout<<x/2*100/...
#include <cstdio> #include <algorithm> #include <cmath> #include <queue> #include <vector> #include <map> #include <set> using namespace std; typedef pair<int , int> P2; typedef pair<pair<int , int> , int> P3; typedef pair<pair<int , int> , pair<int , int> > P4; #define Fst first #define Snd second #define PB(a) push...
#include<bits/stdc++.h> using namespace std; typedef long long ll; signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(20); ll x; cin>>x; double p; cin>>p; if(abs(p-100)<0.01){ x++; cout << x/2 << endl; return 0; } ...
#include<stdio.h> #include<vector> #include<algorithm> using namespace std; int main() { int num,pr; scanf("%d%d",&num,&pr); if(num%2==1)num++; printf("%lf\n",(double)num/(1.0-double(100-pr)/double(100)+double(pr)/double(100))); }
#include "bits/stdc++.h" #include <unordered_set> #define _CRT_SECURE_NO_WARNINGS #define FOR(i, x, n) for(decltype(x) i = (x); i < (n); i++) #define REP(i, n) for(decltype(n) i = 0; i < (n); i++) #define RREP(i, n) for (decltype(n) i = (n) - 1; i >= 0; i--) #define ALL(a) (a).begin(),(a).end() #define SORT(c) sort(...
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef double ld; //#define ll __int128 //#define int ll //#define char ll //#define double ld typedef vector<char> vc; typedef vector <vc> vvc; typedef vector <vvc> vvvc; typedef pair<int, int> pii;...
#include <bits/stdc++.h> using namespace std; int main(){ int x, p; cin >> x >> p; x = (x + 1) / 2; cout << fixed << setprecision(12) << 100. / p * x << endl; return 0; }
#include <iostream> #include <fstream> #include <cstdio> #include <cmath> #include <vector> #include <cstring> #include <string> #include <set> #include <map> #include <stack> #include <queue> #include <algorithm> using namespace std; #define REP(i,n) for(int i=0; i<n; ++i) #define FOR(i,a,b) for(int i=a; i<=b; ++i) ...
#include <string> #include <queue> #include <stack> #include <vector> #include <sstream> #include <algorithm> #include <deque> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <list> #include <cstdio> #include <iostream> #include <cmath> #include <climits> #include <bitset> #incl...
#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<m...
#include<bits/stdc++.h> using namespace std; int main () { long long x,p; double ans; cin >> x >> p; if (x % 2 == 0) { x /= 2; ans = x; ans *= 100; ans /= p; } else { x /= 2; ans = x*p + (x+1)*(100-p); ans /= p; ans += 1; } cout << fixed << setprecision(10) << ans << ...
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ double x,p;cin>>x>>p; int y=x; double iti=(100-2*p)/(double)100; if((int)y%2==1)x+=iti; double ans=x/(1-iti); if((int)y%2==1){ ans+=1.0; } cout<<fixed<<setprecision(12)<<ans<<endl; }
#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define MT make_tuple #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)<<endl #defi...
#include <bits/stdc++.h> using namespace std; #define INF_LL (int64)1e18 #define INF (int32)1e9 #define REP(i, n) for(int i = 0;i < (n);i++) #define FOR(i, a, b) for(int i = (a);i < (b);i++) #define all(x) x.begin(),x.end() #define fs first #define sc second using int32 = int_fast32_t; using uint32 = uint_fast32_t; u...
#include <stdio.h> #include <string.h> int main(){ int n; scanf("%d", &n); int m = 100000; for(int i=0;i<n;i++){ m *= 1.05; if(m%1000 != 0) m = (m/1000+1)*1000; } printf("%d\n", m); }
#include <iostream> using namespace std; int main(){ int i,n=100000,m; cin >> i; while(i--){ n+=n*0.05; m=n%1000; if(m){ n+=1000-m; } } cout << n << endl; return 0; }
#include<iostream> #include<string> using namespace std; int main() { int n; float b=100000; cin>>n; for(int i=0;i<n;i++){ b*=1.05; b=(int)((b+999)*0.001); b*=1000; } cout<<(int)b<<endl; }
#include <iostream> #include <string> using namespace std; int main() { int m = 100000, n; cin >> n; for (int i = 0; i < n; i++) { m *= 1.05; if(m%1000) m += 1000 - m % 1000; } cout << m << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main(){ int n; cin >> n; int a; a=100000; int b; b=0; while(b<n){ a=a/20*21; if((a%1000)!=0){a=a/1000*1000+1000;} b=b+1;} cout << a<<endl; }
#include<stdio.h> int main() { int n; long long int s=100000; scanf("%d",&n); for(int i=0;i<n;i++){ s*=1.05; s+=999; s/=1000; s*=1000; } printf("%d\n",s); return 0; }
#include <iostream> using namespace std; int main(){ int n,i; double m=100.0; cin>>n; for(i=0;i<n;i++){ m*=1.05; if(m-(int)m>0.0){ m+=1.0; m=(int)m; } } cout<<m<<"000"<<endl; return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n, res = 100000; cin >> n; while (n--) { res = (res + res / 20 + 999) / 1000 * 1000; } cout << res << endl; return 0; }
#include<iostream> using namespace std; double money = 100000; int i; int main() { cin>>i; for(i;i>0;--i) { money *= 1.05; money = (long)(money/1000+0.99)*1000; } printf("%.0lf\n",money); }
#include<stdio.h> int main(void){ int n,i,x=100000,z; scanf("%d",&n); for(i=0;i<n;i++) { x = x * 1.05; if(x % 1000 != 0.0) { z = (x / 1000)+1; x = z * 1000; } } printf("%d\n",x); return 0; }
#include <stdio.h> int main(){ int i,n,debt = 100000; scanf("%d",&n); for(i = 0;i < n;i++){ debt = (((int)(debt * 1.05) - 1) / 1000 + 1) * 1000; } printf("%d\n",debt); }
#include <stdio.h> int main(void) { int n; int ans = 100000; scanf("%d", &n); for (int i = 0; i < n; i++){ ans += ans * 0.05; ans = (ans + 999) / 1000 * 1000; } printf("%d\n", ans); return (0); }
#include <iostream> #include <cmath> using namespace std; int main() { int n; cin >> n; int ans = 100000; for (int i = 0; i < n; i++) ans = ceil(ans * 1.05 / 1000) * 1000; cout << ans << endl; }
#include<iostream> using namespace std; int main(){ int n; cin>>n; int lend=100000; for(int i=1;i<=n;i++){ lend=(lend*1.05-1)/1000; lend=(lend+1)*1000; } cout<<lend<<endl; }
#include "bits/stdc++.h" using namespace std; int main() { long long int N; cin >> N; long long int num = 100; while (N--) { num =num* 1.0499999999+1; } cout << num * 1000 << endl; return 0; }
#include<iostream> #include<stdio.h> int main(){ int n,i,a,b,c; std::cin>>a; for(n=0,i=100000;a>n;++n){ i=i+i/20; if(i%1000!=0){ b=i%1000; i=i+1000-b; } } std::cout<<i<<std::endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int y = 100000; for(int i = 0 ; i < n ; i++){ y = y * 105 / 100; if( y % 1000 ) y += 1000 - y % 1000; } cout << y << endl; }