結果

問題 No.1076 寿司打
ユーザー 蜜蜂蜜蜂
提出日時 2020-06-12 21:25:49
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 411 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 1,419 ms
コンパイル使用メモリ 164,648 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 09:42:57
合計ジャッジ時間 3,027 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
4,376 KB
testcase_01 AC 18 ms
4,376 KB
testcase_02 AC 18 ms
4,376 KB
testcase_03 AC 411 ms
4,380 KB
testcase_04 AC 18 ms
4,380 KB
testcase_05 AC 28 ms
4,376 KB
testcase_06 AC 37 ms
4,380 KB
testcase_07 AC 43 ms
4,376 KB
testcase_08 AC 33 ms
4,380 KB
testcase_09 AC 19 ms
4,380 KB
testcase_10 AC 42 ms
4,380 KB
testcase_11 AC 45 ms
4,376 KB
testcase_12 AC 72 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
  long double a;
  cin>>a;
  long double p=0;
  for(int i=0;i<3000;i++){
    double x=1;
    for(int j=0;j<i;j++){
      x*=a;
    }
    x*=i;
    p+=x;
  }
  p*=(1-a);
  cout<<fixed<<setprecision(15);
  cout<<p<<endl;
}
0