結果

問題 No.2516 Credit Creation
ユーザー mkreemmkreem
提出日時 2023-11-14 18:03:28
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 2,509 bytes
コンパイル時間 5,283 ms
コンパイル使用メモリ 308,176 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-11-14 18:03:35
合計ジャッジ時間 6,284 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifndef INCLUDED_main
#define INCLUDED_main

#include __FILE__ // このinclude内ではテンプレートだけ読取

const ll mod = 998244353; using mint = atcoder::modint998244353;
//const ll mod = 1000000007; using mint = atcoder::modint1000000007;



int main(){

  int n; cin >> n;
  double r; cin >> r;
  double rr = 1 - r;

  double ans = 100*((1-pow(rr, n))/(1-rr));
  printf("%.10lf", ans);

}

#else 

#include <bits/stdc++.h>
#include <atcoder/all>

using ll = long long;
using ld = long double;
#define inf 1000000039
#define llinf 393939393939393939
#define fore(i, a) for(auto &i : a)
#define rep(i, a, b) for(int i = a; i < b; i++)
#define erep(i, a, b) for(int i = a; i <= b; i++)
#define rrep(i, a, b) for(int i = a; i >= b; i--)
#define all(x) x.begin(), x.end()
#define rall(x) x.begin(), x.end(), greater<int>()
#define part(x, a, b) x.begin()+a, x.begin()+b+1
#define rpart(x, a, b) x.begin()+a, x.begin()+b+1, std::greater<int>()
#define pcnt(x) __builtin_popcount(x)
#define llpcnt(x) __builtin_popcountll(x)
template<typename T>
using pq = std::priority_queue<T>;
template<typename T>
using pqg = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template<typename T>
bool chmax(T &a, const T &b){
  if(a < b){ a = b; return 1; }
  else return 0;
}
template<typename T>
bool chmin(T &a, const T &b){
  if(a > b){ a = b; return 1; }
  else return 0;
}
// 多次元配列の生成
template<typename T, size_t Dimention>
class Mvector : public std::vector<Mvector<T, Dimention-1>>{
public:
  template<typename N, typename... Sizes>
  Mvector(T init, N n, Sizes... sizes) : std::vector<Mvector<T, Dimention-1> >(n, Mvector<T, Dimention-1>(init, sizes...))
  { }
};
template<typename T>
class Mvector<T, 1> : public std::vector<T>{
public:
  template<typename N>
  Mvector(T init, N n) : std::vector<T>(n, init)
  { }
};
void print(){ std::cout << std::endl; }
// ユニバーサル参照に注意 左辺値参照or右辺値参照を推論
template<typename First, typename... Rest>
void print(First&& first, Rest&&... rest){
  std::cout << first;
  if(sizeof...(rest) != 0){ std::cout << " "; }
  print(std::forward<Rest>(rest)...); // 再帰的にパラメータパックを展開
}
template<typename T>
void print(std::vector<T> &v) {
  for(auto &x : v){
    std::cout << x;
    if(&x != &v.back()){ std::cout << " "; }
  }
  std::cout << std::endl;
}
template<typename T>
void print(std::vector<std::vector<T>> &v) {
  for(auto &x : v) print(x);
}

using namespace std;

#endif
0