結果

問題 No.1616 Joke
ユーザー LV3zJigVW57oPGy
提出日時 2022-10-27 17:13:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 300 bytes
コンパイル時間 1,436 ms
コンパイル使用メモリ 158,072 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 02:31:20
合計ジャッジ時間 2,259 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h> 
using namespace std;
#include <ios>
#include <iomanip>
  
int main() {
  int a;
  cin >>a;
  double count = 0;
  double count2 =0;
  double k=1;
  for(int i=1;i<=a;i++){
    if(a%i==0){
      count += k;
      count2 =count2+1/k;
    }
    k++;
  }
  cout << count/count2;
}
0