QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#799236#667. Randomized Binary Search TreeKazemaruTL 0ms3936kbC++17422b2024-12-05 08:53:012024-12-05 08:53:01

Judging History

你现在查看的是最新测评结果

  • [2024-12-05 08:53:01]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:3936kb
  • [2024-12-05 08:53:01]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define f(i,j,k) for(int i=j;i<=k;++i)
#define g(i,j,k) for(int i=j;i>=k;--i)
int n,m,s,l;
const int N=5e4;
double f[N],g[N],h[N];
signed main(){
	cin>>n;
	f(p,1,n){
		if(p>50){h[p]=1;continue;}f[0]=1;
		f(i,0,n)f(j,0,n-i)g[i+j+1]+=f[i]*f[j];
		f(i,0,n)f[i]=g[i]/i,g[i]=0;h[p]=f[n];
	}
	f(p,1,n)printf("%.5lf\n",h[p]-h[p-1]);
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3820kb

input:

1

output:

1.00000

result:

ok found '1.00000', expected '1.00000', error '0.00000'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3924kb

input:

2

output:

0.00000
1.00000

result:

ok 2 numbers

Test #3:

score: 0
Accepted
time: 0ms
memory: 3936kb

input:

3

output:

0.00000
0.33333
0.66667

result:

ok 3 numbers

Test #4:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

4

output:

0.00000
0.00000
0.66667
0.33333

result:

ok 4 numbers

Test #5:

score: 0
Accepted
time: 0ms
memory: 3932kb

input:

5

output:

0.00000
0.00000
0.33333
0.53333
0.13333

result:

ok 5 numbers

Test #6:

score: 0
Accepted
time: 0ms
memory: 3924kb

input:

6

output:

0.00000
0.00000
0.11111
0.55556
0.28889
0.04444

result:

ok 6 numbers

Test #7:

score: 0
Accepted
time: 0ms
memory: 3872kb

input:

7

output:

0.00000
0.00000
0.01587
0.44444
0.40635
0.12063
0.01270

result:

ok 7 numbers

Test #8:

score: 0
Accepted
time: 0ms
memory: 3928kb

input:

8

output:

0.00000
0.00000
0.00000
0.28175
0.46667
0.20714
0.04127
0.00317

result:

ok 8 numbers

Test #9:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

9

output:

0.00000
0.00000
0.00000
0.15168
0.46508
0.28783
0.08272
0.01199
0.00071

result:

ok 9 numbers

Test #10:

score: 0
Accepted
time: 0ms
memory: 3928kb

input:

10

output:

0.00000
0.00000
0.00000
0.06984
0.41557
0.35206
0.13201
0.02734
0.00303
0.00014

result:

ok 10 numbers

Test #11:

score: -100
Time Limit Exceeded

input:

30000

output:


result: