QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#799384#9855. Glass Bead GameSGColinAC ✓0ms4048kbC++20341b2024-12-05 12:39:562024-12-05 12:39:57

Judging History

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

  • [2024-12-05 12:39:57]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:4048kb
  • [2024-12-05 12:39:56]
  • 提交

answer

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

#define N 107

ld p[N], ans;

int main() {
	int n; cin >> n;
	for (int i = 1; i <= n; ++i) cin >> p[i];
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j) 
			if (i != j) ans += p[i] * p[j] / (p[i] + p[j]);
	printf("%.10Lf\n", ans);
	return 0;
}

详细

Test #1:

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

input:

2
0.500000 0.500000

output:

0.5000000000

result:

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

Test #2:

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

input:

3
0.500000 0.250000 0.250000

output:

0.9166666667

result:

ok found '0.9166667', expected '0.9166667', error '0.0000000'

Test #3:

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

input:

1
1.000000

output:

0.0000000000

result:

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

Test #4:

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

input:

2
0.538027 0.461973

output:

0.4971078945

result:

ok found '0.4971079', expected '0.4971079', error '0.0000000'

Test #5:

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

input:

3
0.494273 0.190517 0.315210

output:

0.8974534240

result:

ok found '0.8974534', expected '0.8974534', error '0.0000000'

Test #6:

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

input:

4
0.197261 0.087416 0.104439 0.610884

output:

0.9824393171

result:

ok found '0.9824393', expected '0.9824393', error '0.0000000'

Test #7:

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

input:

5
0.306241 0.077563 0.409216 0.059593 0.147387

output:

1.4779374690

result:

ok found '1.4779375', expected '1.4779375', error '0.0000000'

Test #8:

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

input:

10
0.036869 0.154271 0.039121 0.093444 0.015092 0.006355 0.260004 0.159292 0.185205 0.050347

output:

3.0239657966

result:

ok found '3.0239658', expected '3.0239658', error '0.0000000'

Test #9:

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

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.0969732401

result:

ok found '4.0969732', expected '4.0969732', error '0.0000000'

Test #10:

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

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.2967443290

result:

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

Test #11:

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

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.2197396576

result:

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

Test #12:

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

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.9904096749

result:

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

Extra Test:

score: 0
Extra Test Passed