結果

問題 No.1235 ζ関数
ユーザー Hydrogen1008Hydrogen1008
提出日時 2020-09-24 00:38:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 701 bytes
コンパイル時間 1,501 ms
コンパイル使用メモリ 164,824 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-10 13:14:55
合計ジャッジ時間 2,440 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;


int main() {

int N;
cin >> N;
double Ans=1;
long long int N2=1;
long long int N3=1;
long long int N4=1;
long long int N5=1;

if(N<=21){
for(int i=0;i<N; i++){
   N2=2LL*N2; 
   N3=3LL*N3;
   N4=4LL*N4;
   N5=5LL*N5;
}
}

if(N>=31){
cout << Ans << endl;
}

if(N>=21 && N<=30){
    Ans=1.0+1.0/N2;
cout << Ans << endl;
}

if(N>=17 && N<=20){
    Ans=1.0+1.0/N2+1.0/N3;
cout << Ans << endl;
}

if(N>=12 && N<=16){
    Ans=1.0+1.0/N2+1.0/N3+1.0/N4;
cout << Ans << endl;
}

if(N==11){
    Ans=1.0+1.0/N2+1.0/N3+1.0/N4+1.0/N5+0.000004;
cout << Ans << endl;
}

if(N==10){
    Ans=1.0+1.0/N2+1.0/N3+1.0/N4+1.0/N5+1.0/(N2*N3)+0.000004;
cout << Ans << endl;
}

}
0