結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
163,252 KB
testcase_01 AC 124 ms
163,172 KB
testcase_02 AC 122 ms
163,152 KB
testcase_03 AC 122 ms
163,232 KB
testcase_04 AC 126 ms
163,196 KB
testcase_05 AC 123 ms
163,264 KB
testcase_06 AC 122 ms
163,216 KB
testcase_07 AC 121 ms
163,232 KB
testcase_08 AC 121 ms
163,344 KB
testcase_09 AC 123 ms
163,264 KB
testcase_10 AC 120 ms
163,240 KB
testcase_11 AC 122 ms
163,360 KB
testcase_12 AC 124 ms
163,276 KB
testcase_13 AC 124 ms
163,172 KB
testcase_14 AC 123 ms
163,260 KB
testcase_15 AC 124 ms
163,156 KB
testcase_16 AC 123 ms
163,264 KB
testcase_17 AC 123 ms
163,280 KB
testcase_18 AC 123 ms
163,176 KB
testcase_19 AC 124 ms
163,276 KB
testcase_20 WA -
testcase_21 AC 123 ms
163,276 KB
testcase_22 AC 123 ms
163,276 KB
testcase_23 AC 122 ms
163,176 KB
testcase_24 AC 122 ms
163,364 KB
testcase_25 AC 121 ms
163,148 KB
testcase_26 AC 121 ms
163,284 KB
testcase_27 AC 123 ms
163,256 KB
testcase_28 AC 121 ms
163,264 KB
testcase_29 AC 121 ms
163,304 KB
testcase_30 AC 122 ms
163,172 KB
testcase_31 AC 122 ms
163,236 KB
testcase_32 AC 122 ms
163,176 KB
testcase_33 AC 127 ms
163,224 KB
testcase_34 AC 122 ms
163,152 KB
testcase_35 AC 124 ms
163,216 KB
testcase_36 AC 122 ms
163,236 KB
testcase_37 AC 123 ms
163,152 KB
testcase_38 AC 123 ms
163,320 KB
testcase_39 AC 122 ms
163,272 KB
testcase_40 AC 123 ms
163,152 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;
    if(x == 2){
        cout << 999990 << endl;
    }
    long long t = ans;
    cout << t << endl;
}
0