QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#864416#9855. Glass Bead GameZhenLiu#WA 1ms4096kbC++14471b2025-01-20 16:22:352025-01-20 16:22:36

Judging History

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

  • [2025-01-20 16:22:36]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4096kb
  • [2025-01-20 16:22:35]
  • 提交

answer

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



int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    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 * (p[i]*p[j])/(p[i] + p[j]);
        }
    }
    cout << ans << endl;
    return 0;
}

詳細信息

Test #1:

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

input:

2
0.500000 0.500000

output:

0.5

result:

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

Test #2:

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

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

result:

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

Test #4:

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

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: 4096kb

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: -100
Wrong Answer
time: 0ms
memory: 3968kb

input:

5
0.306241 0.077563 0.409216 0.059593 0.147387

output:

1.47794

result:

wrong answer 1st numbers differ - expected: '1.4779375', found: '1.4779400', error = '0.0000017'