結果
| 問題 |
No.1271 初めての級数
|
| コンテスト | |
| ユーザー |
w2w2
|
| 提出日時 | 2020-10-30 21:28:40 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,799 bytes |
| コンパイル時間 | 2,207 ms |
| コンパイル使用メモリ | 192,192 KB |
| 最終ジャッジ日時 | 2025-01-15 16:41:13 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll= long long;
using ld= long double;
using i128= __int128;
using pll= pair<ll, ll>;
using vi= vector<int>;
using vl= vector<ll>;
using vd= vector<ld>;
using vs= vector<string>;
using vi128= vector<i128>;
using vb= vector<bool>;
using vpll= vector<pll>;
using vvi= vector<vi>;
using vvl= vector<vl>;
using vvd= vector<vd>;
using vvs= vector<vs>;
using vvi128= vector<vi128>;
using vvb= vector<vb>;
using vvpll= vector<vpll>;
constexpr ll mod= 1e9 + 7;
// constexpr ll mod= 998244353;
#define ALL(x) (x).begin(), (x).end()
#define _overload(_1, _2, _3, name, ...) name
#define REPBASE(i, a, b) for(ll(i)= (a); (i) < (b); (i)++)
#define RREPBASE(i, a, b) for(ll(i)= (a); (i) >= (b); (i)--)
#define REPB(i, n) REPBASE(i, 0, n)
#define REPS(i, n) REPBASE(i, 1, n + 1)
#define RREP(i, n) RREPBASE(i, n - 1, 0)
#define RREPS(i, n) RREPBASE(i, n, 1)
#define REP(...) _overload(__VA_ARGS__, REPBASE, REPB)(__VA_ARGS__)
#define EACH(x, c) for(auto &x : c)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())
#define YES(n) ((n) ? "YES" : "NO")
#define Yes(n) ((n) ? "Yes" : "No")
#define yes(n) ((n) ? "yes" : "no")
#define SZ(x) ((ll)(x).size())
#define BIT(n) (1LL << (n))
template <class T>
inline bool chmax(T &a, const T &b) {
if(a < b) {
a= b;
return 1;
}
return 0;
}
template <class T>
inline bool chmin(T &a, const T &b) {
if(b < a) {
a= b;
return 1;
}
return 0;
}
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
cout << fixed << setprecision(12);
ld ans = 0;
ll k;
cin >> k;
REP(i,k){
ans += (ld)1 / (1 + i);
}
cout << ans / k << "\n";
}
w2w2