結果

問題 No.1273 はじめのζ関数
ユーザー nawawannawawan
提出日時 2020-10-30 22:58:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 823 bytes
コンパイル時間 705 ms
コンパイル使用メモリ 76,424 KB
実行使用メモリ 163,488 KB
最終ジャッジ日時 2023-09-29 08:03:16
合計ジャッジ時間 8,031 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 134 ms
163,200 KB
testcase_01 AC 135 ms
163,488 KB
testcase_02 AC 136 ms
163,360 KB
testcase_03 AC 135 ms
163,316 KB
testcase_04 AC 135 ms
163,204 KB
testcase_05 AC 133 ms
163,252 KB
testcase_06 AC 136 ms
163,252 KB
testcase_07 AC 135 ms
163,212 KB
testcase_08 AC 136 ms
163,272 KB
testcase_09 AC 135 ms
163,316 KB
testcase_10 AC 135 ms
163,212 KB
testcase_11 AC 136 ms
163,256 KB
testcase_12 AC 134 ms
163,192 KB
testcase_13 AC 137 ms
163,296 KB
testcase_14 AC 135 ms
163,268 KB
testcase_15 AC 133 ms
163,320 KB
testcase_16 AC 134 ms
163,340 KB
testcase_17 AC 135 ms
163,264 KB
testcase_18 AC 134 ms
163,200 KB
testcase_19 AC 137 ms
163,252 KB
testcase_20 WA -
testcase_21 AC 135 ms
163,300 KB
testcase_22 AC 134 ms
163,300 KB
testcase_23 AC 136 ms
163,264 KB
testcase_24 AC 136 ms
163,204 KB
testcase_25 AC 135 ms
163,256 KB
testcase_26 AC 135 ms
163,268 KB
testcase_27 AC 135 ms
163,316 KB
testcase_28 AC 137 ms
163,244 KB
testcase_29 AC 140 ms
163,312 KB
testcase_30 AC 136 ms
163,200 KB
testcase_31 AC 137 ms
163,320 KB
testcase_32 AC 136 ms
163,200 KB
testcase_33 AC 134 ms
163,220 KB
testcase_34 AC 136 ms
163,208 KB
testcase_35 AC 134 ms
163,200 KB
testcase_36 AC 136 ms
163,312 KB
testcase_37 AC 135 ms
163,300 KB
testcase_38 AC 135 ms
163,220 KB
testcase_39 AC 136 ms
163,148 KB
testcase_40 AC 138 ms
163,320 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int x;
    cin >> x;
    double ans = 0;
    long long INF = 1e15;
    vector<vector<long long>> vec(100000, vector<long long> (200, -1));
    for(int i = 2; i < 100000; i++){
        vec[i][0] = 1;
        for(int j = 1; j < 200; j++){
            if(INF / (long long)i < vec[i][j - 1]){
                vec[i][j] = -1;
                break;
            }
            else vec[i][j] = vec[i][j - 1] * (long long)i;
        }
    }
    for(int i = x; i < 200; i++){
        for(int j = 2; j < 100000; j++){
            if(vec[j][i] == -1) break;
            ans += 1 / (double)vec[j][i] * 1e6;
        }
    }
    long long t = ans;
    cout << t << endl;
}
0