結果

問題 No.1273 はじめのζ関数
ユーザー KY2001KY2001
提出日時 2020-10-30 22:29:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,499 bytes
コンパイル時間 2,041 ms
コンパイル使用メモリ 197,612 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-29 07:10:50
合計ジャッジ時間 25,429 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 524 ms
4,376 KB
testcase_01 AC 524 ms
4,380 KB
testcase_02 AC 525 ms
4,376 KB
testcase_03 AC 514 ms
4,376 KB
testcase_04 AC 523 ms
4,376 KB
testcase_05 AC 524 ms
4,376 KB
testcase_06 AC 518 ms
4,376 KB
testcase_07 AC 523 ms
4,376 KB
testcase_08 AC 514 ms
4,380 KB
testcase_09 AC 521 ms
4,376 KB
testcase_10 AC 513 ms
4,376 KB
testcase_11 AC 523 ms
4,376 KB
testcase_12 AC 523 ms
4,376 KB
testcase_13 AC 514 ms
4,380 KB
testcase_14 AC 526 ms
4,380 KB
testcase_15 AC 523 ms
4,376 KB
testcase_16 AC 523 ms
4,376 KB
testcase_17 AC 521 ms
4,380 KB
testcase_18 AC 523 ms
4,380 KB
testcase_19 AC 523 ms
4,380 KB
testcase_20 WA -
testcase_21 AC 515 ms
4,376 KB
testcase_22 AC 513 ms
4,376 KB
testcase_23 AC 514 ms
4,376 KB
testcase_24 AC 513 ms
4,376 KB
testcase_25 AC 514 ms
4,380 KB
testcase_26 AC 513 ms
4,380 KB
testcase_27 AC 512 ms
4,376 KB
testcase_28 AC 513 ms
4,380 KB
testcase_29 AC 513 ms
4,380 KB
testcase_30 AC 515 ms
4,380 KB
testcase_31 AC 515 ms
4,380 KB
testcase_32 AC 514 ms
4,376 KB
testcase_33 AC 514 ms
4,380 KB
testcase_34 AC 515 ms
4,376 KB
testcase_35 AC 513 ms
4,376 KB
testcase_36 AC 514 ms
4,376 KB
testcase_37 AC 515 ms
4,376 KB
testcase_38 AC 514 ms
4,380 KB
testcase_39 AC 515 ms
4,380 KB
testcase_40 AC 527 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)            // [0, b)
#define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++) // [a, b)
#define rep3(i, a, b)                                           // reversed [a, b] so [b, b-1, ... a]
#define FOR(i, a) for (auto &i: a)
#define ALL(obj) begin(obj), end(obj)
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define SUM(x) accumulate(ALL(x), 0LL)
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))

using namespace std;
const int MOD    = (int)(1e9 + 7);
const int INF    = (int)(1e13 + 7);
const double EPS = 1e-14;
const double PI  = acos(-1);

int CEIL(int a, int b) { return (a >= 0 ? (a + (b - 1)) / b : (a - (b - 1)) / b); } //ceil() for int
int mod(int a, int b) { return a >= 0 ? a % b : a - (b * CEIL(a, b)); }             //always return positive num
int pow_mod(int a, int b) {                                                         //return x^y in order(log(y))
  int res = 1;
  for (a %= MOD; b; a = a * a % MOD, b >>= 1)
    if (b & 1) res = res * a % MOD;
  return res;
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int x;
  cin >> x;
  double ans = -1000;
  rep2(i, x, x + 1000) {
    double zeta = 0;
    rep2(j, 1, 10000) {
      zeta += 1 / pow(j, i);
    }
    ans += zeta;
  }
  cout << (int)floor(ans * pow(10, 6)) << endl;
}
0