結果

問題 No.1273 はじめのζ関数
ユーザー nawawannawawan
提出日時 2020-10-30 22:44:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 833 bytes
コンパイル時間 703 ms
コンパイル使用メモリ 75,480 KB
実行使用メモリ 163,532 KB
最終ジャッジ日時 2023-09-29 07:43:37
合計ジャッジ時間 7,422 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
163,208 KB
testcase_01 AC 121 ms
163,532 KB
testcase_02 AC 122 ms
163,364 KB
testcase_03 AC 122 ms
163,420 KB
testcase_04 AC 123 ms
163,284 KB
testcase_05 AC 123 ms
163,304 KB
testcase_06 AC 122 ms
163,528 KB
testcase_07 AC 122 ms
163,456 KB
testcase_08 AC 122 ms
163,376 KB
testcase_09 AC 120 ms
163,304 KB
testcase_10 AC 123 ms
163,236 KB
testcase_11 AC 122 ms
163,204 KB
testcase_12 AC 123 ms
163,360 KB
testcase_13 AC 122 ms
163,304 KB
testcase_14 AC 123 ms
163,364 KB
testcase_15 AC 123 ms
163,200 KB
testcase_16 AC 123 ms
163,368 KB
testcase_17 AC 124 ms
163,296 KB
testcase_18 AC 121 ms
163,304 KB
testcase_19 AC 123 ms
163,236 KB
testcase_20 WA -
testcase_21 AC 122 ms
163,244 KB
testcase_22 AC 124 ms
163,256 KB
testcase_23 AC 124 ms
163,452 KB
testcase_24 AC 122 ms
163,364 KB
testcase_25 AC 121 ms
163,532 KB
testcase_26 AC 122 ms
163,224 KB
testcase_27 AC 124 ms
163,312 KB
testcase_28 AC 122 ms
163,152 KB
testcase_29 AC 121 ms
163,368 KB
testcase_30 AC 122 ms
163,360 KB
testcase_31 AC 123 ms
163,296 KB
testcase_32 AC 122 ms
163,200 KB
testcase_33 AC 121 ms
163,280 KB
testcase_34 AC 127 ms
163,232 KB
testcase_35 AC 120 ms
163,220 KB
testcase_36 AC 123 ms
163,364 KB
testcase_37 AC 122 ms
163,168 KB
testcase_38 AC 125 ms
163,376 KB
testcase_39 AC 124 ms
163,156 KB
testcase_40 AC 127 ms
163,308 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 = 1e18;
    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];
        }
    }
    ans *= 1e6;
    long long t = ans;
    cout << t << endl;
}
0