QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#359270 | #5557. Enjoyable Entree | crsfaa# | AC ✓ | 1ms | 6024kb | C++14 | 758b | 2024-03-20 15:38:16 | 2024-03-20 15:38:17 |
Judging History
answer
#include<bits/stdc++.h>
#define Yukinoshita namespace
#define Yukino std
#define int long long
using Yukinoshita Yukino;
int read()
{
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9') w=ch=='-'?-1:1,ch=getchar();
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
return s*w;
}
double f1[2000000],f2[2000000];
signed main()
{
int n=read(),i;
if(n==1)
{
puts("100.0 0.0");
return 0;
}
if(n==2)
{
puts("0.0 100.0");
return 0;
}
double p1,p2;
f1[1]=1,f2[2]=1;
for(i=3;i<=n;i++)
{
p1=f1[i]=(f1[i-2]+f1[i-1])/2;
if(fabs(f1[i]-f1[i-1])<1e-12) break;
}
for(i=3;i<=n;i++)
{
p2=f2[i]=(f2[i-2]+f2[i-1])/2;
if(fabs(f2[i]-f2[i-1])<1e-12) break;
}
printf("%.10lf %.10lf",p1*100,p2*100);
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3660kb
input:
1
output:
100.0 0.0
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 1ms
memory: 6020kb
input:
3
output:
50.0000000000 50.0000000000
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 6020kb
input:
7
output:
34.3750000000 65.6250000000
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
2
output:
0.0 100.0
result:
ok 2 numbers
Test #5:
score: 0
Accepted
time: 1ms
memory: 5912kb
input:
4
output:
25.0000000000 75.0000000000
result:
ok 2 numbers
Test #6:
score: 0
Accepted
time: 1ms
memory: 5828kb
input:
5
output:
37.5000000000 62.5000000000
result:
ok 2 numbers
Test #7:
score: 0
Accepted
time: 1ms
memory: 5912kb
input:
6
output:
31.2500000000 68.7500000000
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 0ms
memory: 5916kb
input:
8
output:
32.8125000000 67.1875000000
result:
ok 2 numbers
Test #9:
score: 0
Accepted
time: 1ms
memory: 5960kb
input:
9
output:
33.5937500000 66.4062500000
result:
ok 2 numbers
Test #10:
score: 0
Accepted
time: 1ms
memory: 5952kb
input:
10
output:
33.2031250000 66.7968750000
result:
ok 2 numbers
Test #11:
score: 0
Accepted
time: 0ms
memory: 5916kb
input:
11
output:
33.3984375000 66.6015625000
result:
ok 2 numbers
Test #12:
score: 0
Accepted
time: 1ms
memory: 6024kb
input:
12
output:
33.3007812500 66.6992187500
result:
ok 2 numbers
Test #13:
score: 0
Accepted
time: 1ms
memory: 5968kb
input:
13
output:
33.3496093750 66.6503906250
result:
ok 2 numbers
Test #14:
score: 0
Accepted
time: 0ms
memory: 6016kb
input:
14
output:
33.3251953125 66.6748046875
result:
ok 2 numbers
Test #15:
score: 0
Accepted
time: 1ms
memory: 5912kb
input:
15
output:
33.3374023438 66.6625976562
result:
ok 2 numbers
Test #16:
score: 0
Accepted
time: 0ms
memory: 5852kb
input:
16
output:
33.3312988281 66.6687011719
result:
ok 2 numbers
Test #17:
score: 0
Accepted
time: 1ms
memory: 5968kb
input:
17
output:
33.3343505859 66.6656494141
result:
ok 2 numbers
Test #18:
score: 0
Accepted
time: 1ms
memory: 6008kb
input:
18
output:
33.3328247070 66.6671752930
result:
ok 2 numbers
Test #19:
score: 0
Accepted
time: 0ms
memory: 5964kb
input:
19
output:
33.3335876465 66.6664123535
result:
ok 2 numbers
Test #20:
score: 0
Accepted
time: 1ms
memory: 6016kb
input:
20
output:
33.3332061768 66.6667938232
result:
ok 2 numbers
Test #21:
score: 0
Accepted
time: 0ms
memory: 5916kb
input:
21
output:
33.3333969116 66.6666030884
result:
ok 2 numbers
Test #22:
score: 0
Accepted
time: 0ms
memory: 5828kb
input:
22
output:
33.3333015442 66.6666984558
result:
ok 2 numbers
Test #23:
score: 0
Accepted
time: 0ms
memory: 5912kb
input:
23
output:
33.3333492279 66.6666507721
result:
ok 2 numbers
Test #24:
score: 0
Accepted
time: 1ms
memory: 5964kb
input:
24
output:
33.3333253860 66.6666746140
result:
ok 2 numbers
Test #25:
score: 0
Accepted
time: 0ms
memory: 5952kb
input:
25
output:
33.3333373070 66.6666626930
result:
ok 2 numbers
Test #26:
score: 0
Accepted
time: 1ms
memory: 5912kb
input:
26
output:
33.3333313465 66.6666686535
result:
ok 2 numbers
Test #27:
score: 0
Accepted
time: 1ms
memory: 5968kb
input:
27
output:
33.3333343267 66.6666656733
result:
ok 2 numbers
Test #28:
score: 0
Accepted
time: 0ms
memory: 5908kb
input:
28
output:
33.3333328366 66.6666671634
result:
ok 2 numbers
Test #29:
score: 0
Accepted
time: 0ms
memory: 5836kb
input:
29
output:
33.3333335817 66.6666664183
result:
ok 2 numbers
Test #30:
score: 0
Accepted
time: 1ms
memory: 5968kb
input:
30
output:
33.3333332092 66.6666667908
result:
ok 2 numbers
Test #31:
score: 0
Accepted
time: 1ms
memory: 5892kb
input:
645
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #32:
score: 0
Accepted
time: 1ms
memory: 5952kb
input:
9664
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #33:
score: 0
Accepted
time: 1ms
memory: 6020kb
input:
92124
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #34:
score: 0
Accepted
time: 1ms
memory: 5960kb
input:
655217
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #35:
score: 0
Accepted
time: 1ms
memory: 5896kb
input:
1906604
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #36:
score: 0
Accepted
time: 0ms
memory: 6016kb
input:
14158782
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #37:
score: 0
Accepted
time: 0ms
memory: 5888kb
input:
118145010
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #38:
score: 0
Accepted
time: 0ms
memory: 5912kb
input:
2200494025
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #39:
score: 0
Accepted
time: 1ms
memory: 5852kb
input:
43605764225
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #40:
score: 0
Accepted
time: 1ms
memory: 5900kb
input:
804695488029
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #41:
score: 0
Accepted
time: 0ms
memory: 5964kb
input:
6627335577483
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #42:
score: 0
Accepted
time: 1ms
memory: 5848kb
input:
63784486977434
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #43:
score: 0
Accepted
time: 1ms
memory: 6012kb
input:
162874566997492
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #44:
score: 0
Accepted
time: 1ms
memory: 5912kb
input:
7889646630282564
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #45:
score: 0
Accepted
time: 1ms
memory: 5964kb
input:
93757501737327402
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #46:
score: 0
Accepted
time: 1ms
memory: 5904kb
input:
633156281075725080
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #47:
score: 0
Accepted
time: 1ms
memory: 5964kb
input:
999999999999999999
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #48:
score: 0
Accepted
time: 1ms
memory: 5856kb
input:
1000000000000000000
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #49:
score: 0
Accepted
time: 1ms
memory: 5960kb
input:
2147483646
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #50:
score: 0
Accepted
time: 1ms
memory: 5912kb
input:
2147483647
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #51:
score: 0
Accepted
time: 1ms
memory: 5848kb
input:
2147483648
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #52:
score: 0
Accepted
time: 1ms
memory: 5952kb
input:
2147483649
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #53:
score: 0
Accepted
time: 0ms
memory: 5908kb
input:
4294967294
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #54:
score: 0
Accepted
time: 0ms
memory: 6020kb
input:
4294967295
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #55:
score: 0
Accepted
time: 1ms
memory: 5904kb
input:
4294967296
output:
33.3333333333 66.6666666667
result:
ok 2 numbers
Test #56:
score: 0
Accepted
time: 1ms
memory: 5964kb
input:
4294967297
output:
33.3333333333 66.6666666667
result:
ok 2 numbers