| Task: | Arvonta |
| Sender: | vgtcross |
| Submission time: | 2025-09-05 18:06:10 +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 MODE 1
#if MODE
#define debug(x) cout << #x << ": " << (x) << endl
#define log(x) cout << (x) << endl
#define test(x) x
#else
#define debug(x)
#define log(x)
#define test(x)
#endif
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
#define X real()
#define Y imag()
using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using P = complex<ll>;
template<typename S, typename T = S> void chmin(S &s, T t) {s = s < t ? s : t;}
template<typename S, typename T = S> void chmax(S &s, T t) {s = s > t ? s : t;}
const ll M = 1000000007; // 998244353
void solve() {
int n;
cin >> n;
ld p = 1 - 1.0 / n;
ld q = 1;
for (int i = 0; i < n; ++i) q *= p;
q = 1-q;
cout << fixed << setprecision(9);
cout << q << '\n';
}
int main() {
cin.tie(0) -> sync_with_stdio(0);
int t = 0;
if (t == 0) cin >> t;
while (t--) solve();
return 0;
}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.000000000 0.750000000 0.703703704 0.683593750 0.672320000 ... 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.000000000 0.750000000 0.703703704 0.683593750 0.672320000 ... Truncated |
