結果
| 問題 |
No.1273 はじめのζ関数
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-11-07 22:06:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 282 bytes |
| コンパイル時間 | 594 ms |
| コンパイル使用メモリ | 68,660 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-22 14:51:46 |
| 合計ジャッジ時間 | 1,429 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 40 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main()
| ^~~~
ソースコード
#include<iostream>
#include<cmath>
using namespace std;
int x;
main()
{
cin>>x;
if(x==2)
{
cout<<1000000<<endl;
return 0;
}
double ans=0;
for(int i=2;;i++)
{
long t=i-1;
for(int j=1;t<1e10&&j<x;j++)t*=i;
if(t>1e10)break;
ans+=1e6/t;
}
cout<<floor(ans)<<endl;
}