QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#735094 | #9283. Socks Drying | rotcar07 | AC ✓ | 6ms | 3948kb | C++23 | 797b | 2024-11-11 17:18:21 | 2024-11-11 17:18:22 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr double sb[5][5]={{0.5000000000,0.6000000000,0.6428571429,0.6666666667,0.6818181818,},{1.0000000000,1.2000000000,1.2857142857,1.3333333333,1.3636363636,},{1.5000000000,1.8000000000,1.9285714286,2.0000000000,2.0454545455,},{2.0000000000,2.4000000000,2.5714285714,2.6666666667,2.7272727273,},{2.5000000000,3.0000000000,3.2142857143,3.3333333333,3.4090909091,},};
int main(){
std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
double ans=0;
int n,cnt[5]={};cin>>n;
for(int i=1,x;i<=n;i++)cin>>x,cnt[x-1]++;
for(int i=0;i<5;i++) ans+=cnt[i]*3*(i+1)+(cnt[i])*(cnt[i]-1.0)*sb[i][i];
for(int i=0;i<5;i++)for(int j=i+1;j<5;j++)ans+=cnt[i]*(sb[i][j]+sb[j][i])*cnt[j];
cout<<fixed<<setprecision(10)<<ans<<'\n';
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3808kb
input:
1 1
output:
3.0000000000
result:
ok found '3.0000000', expected '3.0000000', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
1 3
output:
9.0000000000
result:
ok found '9.0000000', expected '9.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
2 1 1
output:
7.0000000000
result:
ok found '7.0000000', expected '7.0000000', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
3 3 2 2
output:
29.5714285714
result:
ok found '29.5714286', expected '29.5714286', error '0.0000000'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
15 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
output:
662.3402597409
result:
ok found '662.3402597', expected '662.3402597', error '0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3948kb
input:
25 1 1 4 3 3 3 2 5 1 4 4 2 5 5 3 5 2 4 2 1 2 5 1 3 4
output:
1335.7316017330
result:
ok found '1335.7316017', expected '1335.7316017', error '0.0000000'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
50 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5
output:
4989.9696969760
result:
ok found '4989.9696970', expected '4989.9696970', error '0.0000000'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3948kb
input:
500 4 3 3 3 4 5 1 4 4 4 1 3 4 2 3 3 1 2 2 2 1 5 5 2 2 2 4 2 5 3 2 3 3 5 3 1 1 1 1 2 5 1 5 1 2 1 1 3 4 5 3 4 1 1 4 1 3 2 1 4 4 5 1 1 5 3 4 2 4 3 5 2 2 4 3 5 2 5 4 5 5 2 2 1 2 4 2 1 5 3 1 5 1 4 2 2 2 5 1 3 2 2 5 4 2 4 2 5 4 3 1 3 3 4 3 1 3 1 5 3 5 2 2 2 1 4 2 3 4 3 3 1 5 4 2 4 1 5 3 5 3 3 4 4 5 1 5 2 ...
output:
467230.8658015600
result:
ok found '467230.8658016', expected '467230.8658009', error '0.0000000'
Test #9:
score: 0
Accepted
time: 6ms
memory: 3852kb
input:
200000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
20000500000.0000000000
result:
ok found '20000500000.0000000', expected '20000500000.0000000', error '0.0000000'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3864kb
input:
10000 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ...
output:
341025000.0009090304
result:
ok found '341025000.0009090', expected '341025000.0000000', error '0.0000000'
Test #11:
score: 0
Accepted
time: 6ms
memory: 3904kb
input:
200000 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5...
output:
136365954545.8181915283
result:
ok found '136365954545.8181915', expected '136365954545.4545441', error '0.0000000'
Test #12:
score: 0
Accepted
time: 6ms
memory: 3864kb
input:
200000 4 4 4 4 4 4 4 4 5 4 5 5 4 5 5 4 4 5 4 4 4 5 4 5 4 5 5 5 5 4 4 5 4 4 5 4 5 5 4 4 5 4 5 5 4 5 5 5 5 4 4 5 5 5 4 4 5 5 5 5 5 4 5 4 5 4 4 5 4 4 5 5 4 5 4 4 4 5 4 4 4 5 5 5 4 4 5 5 4 4 5 4 4 5 4 5 5 5 5 4 5 4 4 5 4 5 5 5 4 5 5 5 4 5 4 5 4 4 4 5 5 4 4 5 4 4 4 5 4 5 4 4 4 4 5 4 4 4 5 4 4 4 4 5 5 5 5...
output:
121365728788.2424163818
result:
ok found '121365728788.2424164', expected '121365728787.8787842', error '0.0000000'
Test #13:
score: 0
Accepted
time: 4ms
memory: 3832kb
input:
150002 1 1 1 2 3 1 2 3 1 1 1 2 3 2 2 2 1 1 3 2 2 2 2 1 3 2 1 1 2 2 3 3 1 3 2 3 2 3 2 3 1 1 2 1 2 3 2 1 1 2 3 1 2 2 2 2 2 1 3 1 2 2 2 1 3 3 3 1 3 3 2 2 2 3 2 2 3 2 2 1 2 3 3 3 2 2 1 1 2 1 1 1 2 3 3 1 3 2 1 1 2 3 2 1 2 1 1 3 3 2 3 1 1 1 2 3 1 2 3 1 1 2 3 2 3 2 2 2 2 1 3 1 1 3 3 3 3 1 2 3 1 2 2 2 2 1 2...
output:
26144672886.6190414429
result:
ok found '26144672886.6190414', expected '26144672886.4761887', error '0.0000000'
Test #14:
score: 0
Accepted
time: 6ms
memory: 3920kb
input:
200000 5 5 5 5 5 5 5 5 5 5 3 4 5 4 4 5 5 5 4 3 5 4 4 3 3 5 5 5 5 5 5 5 3 5 5 4 3 4 3 4 3 5 3 5 4 3 5 4 3 4 5 3 5 3 3 4 4 3 5 3 5 5 5 5 5 5 5 3 5 5 5 4 3 3 5 3 5 3 5 3 5 5 5 3 5 5 5 4 3 4 5 5 3 4 5 4 3 4 5 5 4 5 5 3 4 4 5 5 3 3 5 4 5 3 4 3 5 4 5 5 3 4 5 4 3 4 5 3 5 5 4 3 3 5 5 3 4 5 5 5 4 5 5 4 4 4 4...
output:
113611286688.7543334961
result:
ok found '113611286688.7543335', expected '113611286688.3116913', error '0.0000000'
Test #15:
score: 0
Accepted
time: 6ms
memory: 3852kb
input:
200000 2 3 2 2 2 3 3 2 5 5 2 3 2 3 2 5 3 4 4 4 4 5 5 4 4 4 5 4 4 3 3 3 3 5 3 5 3 2 5 3 2 3 3 5 4 4 5 3 2 4 4 4 4 5 5 4 5 2 3 3 5 3 4 2 3 2 5 3 4 2 3 3 4 4 3 4 3 3 5 5 2 5 5 4 5 3 2 4 4 4 3 4 5 3 4 5 3 3 4 2 3 3 5 5 3 3 3 4 4 2 4 3 3 4 3 2 4 4 4 4 3 5 5 4 4 4 3 5 5 2 5 3 5 3 4 2 3 5 2 5 4 5 4 4 2 5 5...
output:
90698609480.5497741699
result:
ok found '90698609480.5497742', expected '90698609480.5194855', error '0.0000000'
Test #16:
score: 0
Accepted
time: 6ms
memory: 3916kb
input:
200000 1 2 5 1 1 3 5 3 2 3 3 2 2 2 4 5 3 1 3 3 1 3 5 2 2 3 4 2 5 3 4 5 2 5 2 3 2 4 1 5 3 5 3 4 4 1 3 1 2 3 4 3 3 4 2 5 5 4 5 1 2 5 3 4 3 3 2 2 2 1 2 5 5 3 3 5 5 5 2 2 3 1 5 4 4 5 5 2 4 5 2 5 4 3 2 1 5 5 3 5 1 4 1 2 5 4 1 5 2 2 1 2 3 5 4 4 1 4 2 3 2 1 4 1 4 5 1 5 4 1 5 4 4 4 4 4 4 5 3 2 5 3 2 4 4 5 1...
output:
74193619619.1598205566
result:
ok found '74193619619.1598206', expected '74193619619.0476227', error '0.0000000'
Test #17:
score: 0
Accepted
time: 6ms
memory: 3776kb
input:
200000 3 5 5 1 4 3 3 3 5 5 3 4 2 1 5 1 1 4 4 2 4 3 3 5 1 5 5 2 1 4 3 2 3 3 4 4 3 3 5 5 3 5 5 4 3 3 3 2 4 1 3 2 2 2 4 3 5 1 3 3 2 3 1 4 3 3 2 5 2 2 1 2 4 1 2 3 2 4 5 4 2 3 5 4 2 4 4 2 1 5 3 2 1 5 1 4 4 1 5 1 2 3 5 4 1 5 3 3 4 1 5 5 1 1 4 4 3 5 4 2 5 4 4 5 1 1 3 4 1 4 3 2 3 5 5 4 1 2 1 3 1 3 4 4 5 4 5...
output:
74191942588.1122894287
result:
ok found '74191942588.1122894', expected '74191942588.0000000', error '0.0000000'
Test #18:
score: 0
Accepted
time: 6ms
memory: 3916kb
input:
200000 1 3 2 4 4 5 3 3 5 3 5 1 3 2 2 4 5 5 4 5 5 1 4 3 1 3 5 4 2 1 2 3 2 4 3 3 5 4 5 5 1 2 4 2 5 3 2 2 5 4 4 5 5 4 4 3 3 5 1 5 1 3 4 5 5 4 4 3 3 4 1 5 5 5 2 3 4 2 2 5 5 4 3 3 5 5 5 4 5 4 3 5 5 5 4 3 4 1 4 4 5 5 4 4 5 5 4 3 3 5 4 5 3 2 4 3 5 3 4 5 5 1 4 3 4 3 2 1 1 5 5 2 4 5 2 5 4 4 3 3 1 5 4 5 4 1 5...
output:
89542084593.4157104492
result:
ok found '89542084593.4157104', expected '89542084593.2727203', error '0.0000000'
Test #19:
score: 0
Accepted
time: 3ms
memory: 3860kb
input:
199999 4 3 1 5 1 4 3 3 5 5 1 4 3 4 1 4 5 4 3 3 5 4 3 4 4 5 4 5 4 3 1 1 5 3 4 1 3 4 1 3 1 3 1 5 3 1 1 5 4 1 5 4 4 3 1 4 4 4 1 3 3 5 5 1 5 3 4 1 4 3 3 1 5 3 3 3 1 4 3 4 4 4 3 5 4 5 3 1 4 5 3 4 4 1 4 5 3 4 1 1 3 4 3 5 4 5 4 5 3 1 5 5 5 1 3 4 5 1 4 4 5 5 3 5 5 3 1 4 4 4 4 3 5 1 4 1 5 5 5 4 3 3 1 1 4 1 4...
output:
80967504849.8138580322
result:
ok found '80967504849.8138580', expected '80967504849.4285736', error '0.0000000'
Test #20:
score: 0
Accepted
time: 6ms
memory: 3868kb
input:
200000 5 1 1 5 1 5 5 5 1 1 5 5 5 1 5 5 5 5 1 1 5 5 5 5 1 1 5 5 1 5 5 1 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 1 5 5 5 1 1 5 5 5 5 5 5 1 5 5 5 1 1 1 5 5 1 5 5 5 5 5 5 5 1 5 5 5 5 5 5 5 5 5 1 5 5 5 5 1 5 5 5 1 5 5 5 5 5 1 5 5 1 5 1 1 5 1 5 5 1 5 5 1 5 1 5 5 1 1 5 5 5 1 5 5 5 5 1 1 5 5 1 5 5 5 5 5...
output:
101817807677.9028167725
result:
ok found '101817807677.9028168', expected '101817807677.8346252', error '0.0000000'
Test #21:
score: 0
Accepted
time: 6ms
memory: 3772kb
input:
199999 4 2 4 4 4 4 4 2 2 4 4 4 2 4 4 2 4 4 4 2 2 2 4 2 4 4 4 4 4 4 2 4 4 2 4 4 4 4 4 2 4 4 2 4 4 4 4 2 4 4 4 4 4 4 4 2 4 2 4 4 2 4 2 2 4 4 4 4 4 4 4 4 4 2 2 4 4 4 2 2 4 4 4 4 4 4 2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 4 4 4 4 4 4 4 4 2 4 4 2 4 4 2 4 2 4 4 4 4 4 4 4 4 2 4 2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2...
output:
91000121202.5241851807
result:
ok found '91000121202.5241852', expected '91000121202.0242462', error '0.0000000'
Extra Test:
score: 0
Extra Test Passed