結果
| 問題 | No.1273 はじめのζ関数 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-30 21:45:51 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 19 ms / 2,000 ms |
| コード長 | 290 bytes |
| 記録 | |
| コンパイル時間 | 1,308 ms |
| コンパイル使用メモリ | 208,372 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-14 20:58:18 |
| 合計ジャッジ時間 | 3,259 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 40 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){
int x; scanf("%d",&x);
if(x==2){
puts("1000000");
return 0;
}
double ans=0;
for(int i=2;i<1e6;i++){
ans+=1.0/(pow(i,x-1)*(i-1));
}
printf("%d\n",int(ans*1e6));
return 0;
}