ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#199287 | #2807. 小明的涂色 | wosile | 100 | 179ms | 1332kb | C++11 | 399b | 2023-12-09 10:19:29 | 2023-12-09 12:09:32 |
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int k,n,m;
scanf("%d%d%d",&k,&n,&m);
ll tot=1LL*n*n*m*m;
long double ans=0;
for(int i=1;i<=n;i++)for(int j=1;j<=m;j++){
ll sum=4LL*i*j*(n-i+1)*(m-j+1)-2*i*(n-i+1)-2*j*(m-j+1)+1;
double p=1.0*sum/tot;
p=1-pow(1-p,k);
ans+=p;
}
printf("%.2Lf",ans);
return 0;
//quod erat demonstrandum
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1224kb
input:
1 2 2
output:
2.25
result:
ok single line: '2.25'
Test #2:
score: 10
Accepted
time: 0ms
memory: 1228kb
input:
1 20 20
output:
58.52
result:
ok single line: '58.52'
Test #3:
score: 10
Accepted
time: 0ms
memory: 1228kb
input:
1 19 16
output:
46.18
result:
ok single line: '46.18'
Test #4:
score: 10
Accepted
time: 5ms
memory: 1284kb
input:
100 59 990
output:
55484.94
result:
ok single line: '55484.94'
Test #5:
score: 10
Accepted
time: 11ms
memory: 1328kb
input:
32 407 341
output:
116240.55
result:
ok single line: '116240.55'
Test #6:
score: 10
Accepted
time: 36ms
memory: 1328kb
input:
22 746 624
output:
361402.19
result:
ok single line: '361402.19'
Test #7:
score: 10
Accepted
time: 32ms
memory: 1288kb
input:
74 481 873
output:
385866.87
result:
ok single line: '385866.87'
Test #8:
score: 10
Accepted
time: 3ms
memory: 1328kb
input:
50 164 158
output:
23216.24
result:
ok single line: '23216.24'
Test #9:
score: 10
Accepted
time: 16ms
memory: 1284kb
input:
77 412 452
output:
171908.35
result:
ok single line: '171908.35'
Test #10:
score: 10
Accepted
time: 76ms
memory: 1332kb
input:
100 1000 1000
output:
936523.83
result:
ok single line: '936523.83'