Task: | Arvonta |
Sender: | MojoLake |
Submission time: | 2025-09-07 01:20:53 +0300 |
Language: | C++ (C++20) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 37 |
#2 | ACCEPTED | 63 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.00 s | 1, 2 | details |
#2 | ACCEPTED | 0.01 s | 2 | details |
Code
#include <bits/stdc++.h> #define all(x) begin(x), end(x) #define sz(x) (int)(x).size() using namespace std; using ll = long long; const int inf = 1e9; const ll LLinf = 1e18; void solve() { int n; cin >> n; // 1 - (1/n)**n double x = ((double)(n - 1))/ ((double)n); double minus = 1; for (int _ = 0; _ < n; ++_) { minus *= x; } cout << fixed << setprecision(15) << 1 - minus << "\n"; } int main() { cin.tie(0)->sync_with_stdio(0); int tt = 1; cin >> tt; while (tt--) { solve(); } }
Test details
Test 1
Group: 1, 2
Verdict: ACCEPTED
input |
---|
10 1 2 3 4 ... |
correct output |
---|
1.0 0.75 0.7037037037 0.68359375 0.67232 ... |
user output |
---|
1.000000000000000 0.750000000000000 0.703703703703704 0.683593750000000 0.672320000000000 ... Truncated |
Test 2
Group: 2
Verdict: ACCEPTED
input |
---|
1000 1 2 3 4 ... |
correct output |
---|
1.0 0.75 0.7037037037 0.68359375 0.67232 ... |
user output |
---|
1.000000000000000 0.750000000000000 0.703703703703704 0.683593750000000 0.672320000000000 ... Truncated |