QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#184673 | #5557. Enjoyable Entree | rgnerdplayer | AC ✓ | 5ms | 11472kb | C++20 | 775b | 2023-09-21 02:59:31 | 2023-09-21 02:59:32 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
auto solve = [&]() {
cout << fixed << setprecision(20);
i64 n;
cin >> n;
if (n == 1) {
cout << 100.0 << ' ' << 0.0 << '\n';
return;
}
n = min(n, 1LL << 20);
vector<double> f(n);
f[0] = 100, f[1] = 0;
for (int i = 2; i < n; i++) {
f[i] = (f[i - 1] + f[i - 2]) / 2;
}
cout << f[n - 1] << ' ' << 100 - f[n - 1] << '\n';
};
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3784kb
input:
1
output:
100.00000000000000000000 0.00000000000000000000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
3
output:
50.00000000000000000000 50.00000000000000000000
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
7
output:
34.37500000000000000000 65.62500000000000000000
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
2
output:
0.00000000000000000000 100.00000000000000000000
result:
ok 2 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
4
output:
25.00000000000000000000 75.00000000000000000000
result:
ok 2 numbers
Test #6:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
5
output:
37.50000000000000000000 62.50000000000000000000
result:
ok 2 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
6
output:
31.25000000000000000000 68.75000000000000000000
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 0ms
memory: 3768kb
input:
8
output:
32.81250000000000000000 67.18750000000000000000
result:
ok 2 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
9
output:
33.59375000000000000000 66.40625000000000000000
result:
ok 2 numbers
Test #10:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
10
output:
33.20312500000000000000 66.79687500000000000000
result:
ok 2 numbers
Test #11:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
11
output:
33.39843750000000000000 66.60156250000000000000
result:
ok 2 numbers
Test #12:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
12
output:
33.30078125000000000000 66.69921875000000000000
result:
ok 2 numbers
Test #13:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
13
output:
33.34960937500000000000 66.65039062500000000000
result:
ok 2 numbers
Test #14:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
14
output:
33.32519531250000000000 66.67480468750000000000
result:
ok 2 numbers
Test #15:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
15
output:
33.33740234375000000000 66.66259765625000000000
result:
ok 2 numbers
Test #16:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
16
output:
33.33129882812500000000 66.66870117187500000000
result:
ok 2 numbers
Test #17:
score: 0
Accepted
time: 0ms
memory: 4004kb
input:
17
output:
33.33435058593750000000 66.66564941406250000000
result:
ok 2 numbers
Test #18:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
18
output:
33.33282470703125000000 66.66717529296875000000
result:
ok 2 numbers
Test #19:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
19
output:
33.33358764648437500000 66.66641235351562500000
result:
ok 2 numbers
Test #20:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
20
output:
33.33320617675781250000 66.66679382324218750000
result:
ok 2 numbers
Test #21:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
21
output:
33.33339691162109375000 66.66660308837890625000
result:
ok 2 numbers
Test #22:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
22
output:
33.33330154418945312500 66.66669845581054687500
result:
ok 2 numbers
Test #23:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
23
output:
33.33334922790527343750 66.66665077209472656250
result:
ok 2 numbers
Test #24:
score: 0
Accepted
time: 0ms
memory: 4008kb
input:
24
output:
33.33332538604736328125 66.66667461395263671875
result:
ok 2 numbers
Test #25:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
25
output:
33.33333730697631835938 66.66666269302368164062
result:
ok 2 numbers
Test #26:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
26
output:
33.33333134651184082031 66.66666865348815917969
result:
ok 2 numbers
Test #27:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
27
output:
33.33333432674407958984 66.66666567325592041016
result:
ok 2 numbers
Test #28:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
28
output:
33.33333283662796020508 66.66666716337203979492
result:
ok 2 numbers
Test #29:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
29
output:
33.33333358168601989746 66.66666641831398010254
result:
ok 2 numbers
Test #30:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
30
output:
33.33333320915699005127 66.66666679084300994873
result:
ok 2 numbers
Test #31:
score: 0
Accepted
time: 0ms
memory: 4000kb
input:
645
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #32:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
9664
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #33:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
92124
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #34:
score: 0
Accepted
time: 3ms
memory: 8308kb
input:
655217
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #35:
score: 0
Accepted
time: 4ms
memory: 11260kb
input:
1906604
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #36:
score: 0
Accepted
time: 2ms
memory: 11344kb
input:
14158782
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #37:
score: 0
Accepted
time: 2ms
memory: 11404kb
input:
118145010
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #38:
score: 0
Accepted
time: 0ms
memory: 11332kb
input:
2200494025
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #39:
score: 0
Accepted
time: 4ms
memory: 11312kb
input:
43605764225
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #40:
score: 0
Accepted
time: 4ms
memory: 11344kb
input:
804695488029
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #41:
score: 0
Accepted
time: 2ms
memory: 11396kb
input:
6627335577483
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #42:
score: 0
Accepted
time: 5ms
memory: 11408kb
input:
63784486977434
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #43:
score: 0
Accepted
time: 2ms
memory: 11312kb
input:
162874566997492
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #44:
score: 0
Accepted
time: 4ms
memory: 11284kb
input:
7889646630282564
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #45:
score: 0
Accepted
time: 0ms
memory: 11352kb
input:
93757501737327402
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #46:
score: 0
Accepted
time: 5ms
memory: 11256kb
input:
633156281075725080
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #47:
score: 0
Accepted
time: 4ms
memory: 11472kb
input:
999999999999999999
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #48:
score: 0
Accepted
time: 4ms
memory: 11444kb
input:
1000000000000000000
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #49:
score: 0
Accepted
time: 4ms
memory: 9796kb
input:
2147483646
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #50:
score: 0
Accepted
time: 0ms
memory: 11288kb
input:
2147483647
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #51:
score: 0
Accepted
time: 4ms
memory: 11336kb
input:
2147483648
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #52:
score: 0
Accepted
time: 4ms
memory: 11336kb
input:
2147483649
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #53:
score: 0
Accepted
time: 2ms
memory: 11404kb
input:
4294967294
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #54:
score: 0
Accepted
time: 4ms
memory: 11344kb
input:
4294967295
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #55:
score: 0
Accepted
time: 2ms
memory: 11260kb
input:
4294967296
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers
Test #56:
score: 0
Accepted
time: 0ms
memory: 11304kb
input:
4294967297
output:
33.33333333333332859638 66.66666666666667140362
result:
ok 2 numbers