QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#864427#9855. Glass Bead GameZhenLiu#AC ✓1ms3968kbC++14422b2025-01-20 16:28:072025-01-20 16:28:07

Judging History

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

  • [2025-01-20 16:28:07]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3968kb
  • [2025-01-20 16:28:07]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;



int main(){

    int n;
    cin >> n;
    vector<double> p(n + 1);
    for(int i = 1; i <= n; ++i){
        cin >> p[i];
    }
    double ans = 0;
    for(int i = 1; i <= n; ++i){
        for(int j = i + 1; j <= n; ++j){
            ans += 2.0 * (p[i]*p[j])/(p[i] + p[j]);
        }
    }
    printf("%.6lf", ans);
    return 0;
}

詳細信息

Test #1:

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

input:

2
0.500000 0.500000

output:

0.500000

result:

ok found '0.5000000', expected '0.5000000', error '0.0000000'

Test #2:

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

input:

3
0.500000 0.250000 0.250000

output:

0.916667

result:

ok found '0.9166670', expected '0.9166667', error '0.0000003'

Test #3:

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

input:

1
1.000000

output:

0.000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #4:

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

input:

2
0.538027 0.461973

output:

0.497108

result:

ok found '0.4971080', expected '0.4971079', error '0.0000001'

Test #5:

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

input:

3
0.494273 0.190517 0.315210

output:

0.897453

result:

ok found '0.8974530', expected '0.8974534', error '0.0000004'

Test #6:

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

input:

4
0.197261 0.087416 0.104439 0.610884

output:

0.982439

result:

ok found '0.9824390', expected '0.9824393', error '0.0000003'

Test #7:

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

input:

5
0.306241 0.077563 0.409216 0.059593 0.147387

output:

1.477937

result:

ok found '1.4779370', expected '1.4779375', error '0.0000003'

Test #8:

score: 0
Accepted
time: 1ms
memory: 3968kb

input:

10
0.036869 0.154271 0.039121 0.093444 0.015092 0.006355 0.260004 0.159292 0.185205 0.050347

output:

3.023966

result:

ok found '3.0239660', expected '3.0239658', error '0.0000001'

Test #9:

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

input:

15
0.037256 0.092021 0.010070 0.032228 0.117466 0.004701 0.055551 0.001236 0.187293 0.055711 0.207971 0.004382 0.105521 0.088092 0.000501

output:

4.096973

result:

ok found '4.0969730', expected '4.0969732', error '0.0000001'

Test #10:

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

input:

30
0.039333 0.083460 0.009475 0.008942 0.003020 0.037578 0.045489 0.029958 0.001444 0.044862 0.016973 0.049030 0.034943 0.002248 0.026105 0.020958 0.076519 0.058296 0.035587 0.011935 0.024676 0.006303 0.048558 0.000584 0.014267 0.056606 0.002034 0.087229 0.064801 0.058787

output:

10.296744

result:

ok found '10.2967440', expected '10.2967443', error '0.0000000'

Test #11:

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

input:

50
0.001021 0.008859 0.000217 0.009289 0.006963 0.018732 0.007280 0.047461 0.012470 0.028122 0.005435 0.012979 0.015871 0.003407 0.020872 0.037227 0.000613 0.043340 0.018878 0.008492 0.021150 0.020627 0.023751 0.012367 0.029199 0.037501 0.085723 0.001351 0.023855 0.015958 0.007456 0.012490 0.034241 ...

output:

17.219740

result:

ok found '17.2197400', expected '17.2197397', error '0.0000000'

Test #12:

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

input:

100
0.001579 0.004926 0.003032 0.000846 0.000350 0.019884 0.009544 0.015217 0.005413 0.018294 0.000776 0.021315 0.001224 0.040895 0.012111 0.008854 0.019986 0.011898 0.007226 0.015722 0.030665 0.002735 0.016657 0.002375 0.009279 0.027049 0.009811 0.014709 0.004331 0.003090 0.007980 0.001159 0.000640...

output:

33.990410

result:

ok found '33.9904100', expected '33.9904097', error '0.0000000'

Extra Test:

score: 0
Extra Test Passed