結果

問題 No.108 トリプルカードコンプ
ユーザー itezpace
提出日時 2016-11-20 08:25:27
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 57,056 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-27 06:43:09
合計ジャッジ時間 1,452 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;
double Calc(int n){
  double a=0;
  for(int i=1;i<=n;++i){
    double b=1;
    double c=(double)i;
    double d=(b/c);
    a+=d;
  }
  return a;
}
int main(){
  int N;cin>>N;
  double a=Calc(N);
  cerr<<a<<endl;
  int A;
  double b=0;
  for(int i=0;i<N;++i){
    cin>>A;
    int B=min(A,3);
    double C=(double)(3-B);
    double D=(a*C);
    b+=D;
  }
  cout<<b<<endl;
}
0