QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#524046#8682. Waterworlducup-team052AC ✓124ms8376kbC++23809b2024-08-19 09:15:172024-08-19 09:15:17

Judging History

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

  • [2024-08-19 09:15:17]
  • 评测
  • 测评结果:AC
  • 用时:124ms
  • 内存:8376kb
  • [2024-08-19 09:15:17]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,a,b) for(int i=(a);i>=(b);--i)
using namespace std;
int main(){
#ifdef xay5421
	freopen("a.in","r",stdin);
#endif
	int n,m;
	cin>>n>>m;
	vector<vector<int> >a(n,vector<int>(m,0));
	vector<double>s(n);
	rep(i,0,n-1)rep(j,0,m-1)cin>>a[i][j],s[i]+=a[i][j];
	rep(i,0,n-1)s[i]/=m;
	vector<double>x(n+1);
	x[n]=1;
	per(i,n-1,0){
		x[i]=x[i+1]-2./n;
	}
	x[0] = -1;
	// printf("%.20f\n",x[0]);
	vector<double>area(n);
	double S=0;
	per(i,n,1){
		double l=atan2(sqrt(1-x[i]*x[i]),x[i]);
		double r=atan2(sqrt(1-x[i-1]*x[i-1]),x[i-1]);
		area[i-1]=cos(l)-cos(r);
		S+=area[i-1];
	}
	
	rep(i,0,n-1)area[i]/=S;
	double ans=0;
	rep(i,0,n-1){
		ans+=area[i]*s[i];
	}
	printf("%.20f\n",ans);
	return 0;
}

詳細信息

Test #1:

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

input:

2 2
41 65
31 41

output:

44.50000000000000000000

result:

ok found '44.5000000', expected '44.5000000', error '0.0000000'

Test #2:

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

input:

2 3
41 65 31
41 19 15

output:

35.33333333333332859638

result:

ok found '35.3333333', expected '35.3333333', error '0.0000000'

Test #3:

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

input:

2 4
41 65 31 41
19 15 72 11

output:

36.87500000000000000000

result:

ok found '36.8750000', expected '36.8750000', error '0.0000000'

Test #4:

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

input:

3 2
41 65
31 41
19 15

output:

35.33333333333332859638

result:

ok found '35.3333333', expected '35.3333333', error '0.0000000'

Test #5:

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

input:

3 3
41 65 31
41 19 15
72 11 78

output:

41.44444444444444286546

result:

ok found '41.4444444', expected '41.4444444', error '0.0000000'

Test #6:

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

input:

3 4
41 65 31 41
19 15 72 11
78 69 37 23

output:

41.83333333333333570181

result:

ok found '41.8333333', expected '41.8333333', error '0.0000000'

Test #7:

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

input:

4 2
41 65
31 41
19 15
72 11

output:

36.87500000000000000000

result:

ok found '36.8750000', expected '36.8750000', error '0.0000000'

Test #8:

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

input:

4 3
41 65 31
41 19 15
72 11 78
69 37 23

output:

41.83333333333332859638

result:

ok found '41.8333333', expected '41.8333333', error '0.0000000'

Test #9:

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

input:

4 4
41 65 31 41
19 15 72 11
78 69 37 23
29 63 75 4

output:

42.06250000000000000000

result:

ok found '42.0625000', expected '42.0625000', error '0.0000000'

Test #10:

score: 0
Accepted
time: 103ms
memory: 8296kb

input:

998 999
41 65 31 41 19 15 72 11 78 69 37 23 29 63 75 4 5 49 75 99 27 61 62 17 79 61 22 13 49 71 61 8 81 67 80 47 83 88 30 12 74 78 33 23 58 83 76 59 77 85 25 18 98 16 100 79 88 36 53 72 95 93 39 78 5 15 56 26 62 65 57 69 63 31 63 68 46 40 46 15 87 49 47 17 61 8 42 39 64 86 49 43 44 47 69 25 67 58 57...

output:

49.96108232480965938294

result:

ok found '49.9610823', expected '49.9610823', error '0.0000000'

Test #11:

score: 0
Accepted
time: 102ms
memory: 8220kb

input:

1000 1000
41 65 31 41 19 15 72 11 78 69 37 23 29 63 75 4 5 49 75 99 27 61 62 17 79 61 22 13 49 71 61 8 81 67 80 47 83 88 30 12 74 78 33 23 58 83 76 59 77 85 25 18 98 16 100 79 88 36 53 72 95 93 39 78 5 15 56 26 62 65 57 69 63 31 63 68 46 40 46 15 87 49 47 17 61 8 42 39 64 86 49 43 44 47 69 25 67 58 ...

output:

49.96050900000000183354

result:

ok found '49.9605090', expected '49.9605090', error '0.0000000'

Test #12:

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

input:

1000 999
41 65 31 41 19 15 72 11 78 69 37 23 29 63 75 4 5 49 75 99 27 61 62 17 79 61 22 13 49 71 61 8 81 67 80 47 83 88 30 12 74 78 33 23 58 83 76 59 77 85 25 18 98 16 100 79 88 36 53 72 95 93 39 78 5 15 56 26 62 65 57 69 63 31 63 68 46 40 46 15 87 49 47 17 61 8 42 39 64 86 49 43 44 47 69 25 67 58 5...

output:

49.95938238238238682243

result:

ok found '49.9593824', expected '49.9593824', error '0.0000000'

Test #13:

score: 0
Accepted
time: 98ms
memory: 8232kb

input:

999 1000
41 65 31 41 19 15 72 11 78 69 37 23 29 63 75 4 5 49 75 99 27 61 62 17 79 61 22 13 49 71 61 8 81 67 80 47 83 88 30 12 74 78 33 23 58 83 76 59 77 85 25 18 98 16 100 79 88 36 53 72 95 93 39 78 5 15 56 26 62 65 57 69 63 31 63 68 46 40 46 15 87 49 47 17 61 8 42 39 64 86 49 43 44 47 69 25 67 58 5...

output:

49.95938238238237261157

result:

ok found '49.9593824', expected '49.9593824', error '0.0000000'

Test #14:

score: 0
Accepted
time: 35ms
memory: 5880kb

input:

687 598
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

0.00000000000000000000

result:

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

Test #15:

score: 0
Accepted
time: 53ms
memory: 6004kb

input:

868 495
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

99.99999999999903366188

result:

ok found '100.0000000', expected '100.0000000', error '0.0000000'

Test #16:

score: 0
Accepted
time: 98ms
memory: 8332kb

input:

989 999
49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 4...

output:

49.00000000000043343107

result:

ok found '49.0000000', expected '49.0000000', error '0.0000000'

Test #17:

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

input:

3 3
17 0 0
0 0 0
0 0 0

output:

1.88888888888888883955

result:

ok found '1.8888889', expected '1.8888889', error '0.0000000'

Test #18:

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

input:

3 3
0 18 0
0 0 0
0 0 0

output:

2.00000000000000000000

result:

ok found '2.0000000', expected '2.0000000', error '0.0000000'

Test #19:

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

input:

3 3
0 0 19
0 0 0
0 0 0

output:

2.11111111111111071637

result:

ok found '2.1111111', expected '2.1111111', error '0.0000000'

Test #20:

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

input:

3 3
0 0 0
20 0 0
0 0 0

output:

2.22222222222222232091

result:

ok found '2.2222222', expected '2.2222222', error '0.0000000'

Test #21:

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

input:

3 3
0 0 0
0 21 0
0 0 0

output:

2.33333333333333303727

result:

ok found '2.3333333', expected '2.3333333', error '0.0000000'

Test #22:

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

input:

3 3
0 0 0
0 0 22
0 0 0

output:

2.44444444444444419773

result:

ok found '2.4444444', expected '2.4444444', error '0.0000000'

Test #23:

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

input:

3 3
0 0 0
0 0 0
23 0 0

output:

2.55555555555555580227

result:

ok found '2.5555556', expected '2.5555556', error '0.0000000'

Test #24:

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

input:

3 3
0 0 0
0 0 0
0 24 0

output:

2.66666666666666696273

result:

ok found '2.6666667', expected '2.6666667', error '0.0000000'

Test #25:

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

input:

3 3
0 0 0
0 0 0
0 0 25

output:

2.77777777777777812318

result:

ok found '2.7777778', expected '2.7777778', error '0.0000000'

Test #26:

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

input:

4 3
26 0 0
0 0 0
0 0 0
0 0 0

output:

2.16666666666666563046

result:

ok found '2.1666667', expected '2.1666667', error '0.0000000'

Test #27:

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

input:

4 3
0 0 0
0 27 0
0 0 0
0 0 0

output:

2.25000000000000133227

result:

ok found '2.2500000', expected '2.2500000', error '0.0000000'

Test #28:

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

input:

4 3
0 0 0
0 0 0
0 0 28
0 0 0

output:

2.33333333333333348136

result:

ok found '2.3333333', expected '2.3333333', error '0.0000000'

Test #29:

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

input:

4 3
0 0 0
0 0 0
0 0 0
0 0 29

output:

2.41666666666666607455

result:

ok found '2.4166667', expected '2.4166667', error '0.0000000'

Test #30:

score: 0
Accepted
time: 105ms
memory: 8308kb

input:

1000 1000
76 36 68 77 44 98 72 7 5 72 74 71 28 32 74 89 3 95 68 93 64 23 40 2 8 20 59 80 92 24 45 12 76 16 83 71 75 65 81 61 27 37 92 42 87 0 2 47 23 52 71 95 43 67 92 74 60 46 59 6 41 56 23 53 78 61 51 68 68 36 28 35 69 62 92 94 96 62 5 18 67 70 39 4 30 83 44 85 58 79 35 50 15 64 27 60 36 12 60 30 ...

output:

49.94911300000004672484

result:

ok found '49.9491130', expected '49.9491130', error '0.0000000'

Test #31:

score: 0
Accepted
time: 19ms
memory: 4968kb

input:

295 617
68 77 44 98 72 7 5 72 74 71 28 32 74 89 3 95 68 93 64 23 40 2 8 20 59 80 92 24 45 12 76 16 83 71 75 65 81 61 27 37 92 42 87 0 2 47 23 52 71 95 43 67 92 74 60 46 59 6 41 56 23 53 78 61 51 68 68 36 28 35 69 62 92 94 96 62 5 18 67 70 39 4 30 83 44 85 58 79 35 50 15 64 27 60 36 12 60 30 41 14 27...

output:

49.92306128615770433044

result:

ok found '49.9230613', expected '49.9230613', error '0.0000000'

Test #32:

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

input:

969 30
16 99 27 95 88 69 30 22 38 18 89 62 29 76 34 16 20 93 82 43 11 30 51 61 57 91 89 54 67 51
99 20 76 62 34 44 20 66 31 40 23 46 61 28 78 67 63 98 92 55 0 35 73 88 15 4 45 9 35 91
13 10 38 67 36 93 84 22 25 73 39 89 100 29 19 14 63 2 88 21 50 18 48 95 93 17 41 90 13 5
3 50 13 77 54 57 60 11 58 4...

output:

50.06759545923644338927

result:

ok found '50.0675955', expected '50.0675955', error '0.0000000'

Test #33:

score: 0
Accepted
time: 2ms
memory: 4276kb

input:

91 198
46 36 75 94 74 52 20 93 1 9 9 15 40 31 96 17 20 27 99 10 10 22 9 8 41 10 82 13 5 30 60 81 82 22 15 69 54 33 29 77 75 24 68 42 87 5 88 63 1 43 54 99 50 43 9 38 56 87 17 91 41 93 72 44 58 90 29 42 22 62 44 36 83 67 29 17 31 5 34 15 28 39 86 76 30 81 17 20 48 29 15 76 33 67 33 87 59 5 54 76 25 3...

output:

50.17049617049620735543

result:

ok found '50.1704962', expected '50.1704962', error '0.0000000'

Test #34:

score: 0
Accepted
time: 73ms
memory: 7160kb

input:

864 820
54 15 97 27 71 2 11 71 32 50 36 42 80 98 1 42 2 23 40 1 100 35 72 71 34 19 53 73 33 89 78 97 11 3 78 88 64 32 0 5 20 18 99 49 57 47 15 45 36 75 97 65 9 98 20 74 66 86 56 0 79 68 89 13 61 76 3 32 13 9 25 94 65 63 17 6 96 10 54 43 86 29 77 18 72 86 61 99 41 79 97 23 0 43 43 50 25 39 11 85 54 6...

output:

49.94914464769627215901

result:

ok found '49.9491446', expected '49.9491446', error '0.0000000'

Test #35:

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

input:

438 75
97 86 72 15 26 43 35 23 71 27 35 31 61 68 81 16 40 77 80 37 13 25 62 4 94 3 54 28 39 0 16 25 5 71 54 62 53 38 15 97 88 73 52 87 47 54 66 16 98 6 57 34 44 90 17 88 32 58 85 4 6 53 7 91 82 17 84 2 64 72 30 40 20 31 23
35 29 0 89 28 21 65 79 66 0 26 49 50 70 14 56 88 78 57 47 78 86 81 34 87 94 3...

output:

49.86167427701667520523

result:

ok found '49.8616743', expected '49.8616743', error '0.0000000'

Test #36:

score: 0
Accepted
time: 20ms
memory: 4984kb

input:

996 189
29 72 39 97 95 58 42 27 43 16 8 53 5 6 43 10 22 52 71 93 91 47 68 27 78 34 67 93 73 85 95 67 35 86 81 80 90 70 16 42 32 7 95 47 91 35 33 30 1 69 17 49 8 90 46 41 72 62 79 92 33 46 38 48 94 19 59 100 9 0 2 44 81 100 85 30 41 18 94 30 82 71 61 12 32 77 1 8 48 12 27 33 82 7 65 26 88 44 62 46 3 ...

output:

49.94634091923244056943

result:

ok found '49.9463409', expected '49.9463409', error '0.0000000'

Test #37:

score: 0
Accepted
time: 26ms
memory: 5376kb

input:

295 829
47 41 15 1 97 74 65 84 73 87 55 56 65 7 17 17 21 60 23 36 75 93 74 20 53 28 6 48 71 66 31 69 29 52 63 18 68 60 29 60 78 57 13 91 26 15 10 82 80 29 87 60 85 98 77 44 7 16 34 46 42 19 21 51 83 30 70 73 35 37 2 32 30 92 50 32 3 11 8 8 46 66 5 73 70 6 8 41 11 44 65 83 8 78 72 7 28 43 2 72 80 34 ...

output:

49.93950645049169168033

result:

ok found '49.9395065', expected '49.9395065', error '0.0000000'

Test #38:

score: 0
Accepted
time: 18ms
memory: 4976kb

input:

366 459
9 6 7 46 17 59 91 22 58 47 57 29 15 7 12 55 57 90 56 48 14 17 80 24 71 18 33 7 68 14 32 33 22 91 10 13 28 3 73 87 6 81 14 92 6 41 34 79 0 12 79 33 9 80 76 89 82 7 80 53 86 77 25 79 52 1 17 80 36 76 36 53 11 86 88 71 35 76 22 90 25 91 36 27 27 92 55 11 36 92 58 12 77 45 60 64 95 54 97 66 6 36...

output:

49.98733288093622917359

result:

ok found '49.9873329', expected '49.9873329', error '0.0000000'

Test #39:

score: 0
Accepted
time: 26ms
memory: 5332kb

input:

409 604
67 5 74 38 51 30 97 73 88 91 71 11 8 48 5 53 6 15 43 21 100 45 96 40 4 7 55 67 26 22 11 35 51 63 91 24 50 85 18 17 67 77 25 25 25 76 97 39 78 51 72 27 20 52 81 31 39 47 22 13 66 64 39 71 18 95 100 23 10 91 83 53 20 21 52 41 100 69 74 25 39 40 5 67 34 14 3 84 83 8 75 39 42 51 32 75 50 18 35 9...

output:

49.96645428196704585844

result:

ok found '49.9664543', expected '49.9664543', error '0.0000000'

Test #40:

score: 0
Accepted
time: 21ms
memory: 5108kb

input:

693 285
67 92 26 75 70 11 64 33 19 58 85 8 62 53 36 11 17 67 88 65 68 46 72 59 47 80 15 87 90 10 92 46 21 61 75 53 78 15 82 99 57 85 47 39 34 39 38 7 54 81 13 100 16 5 34 15 35 35 87 29 51 82 15 62 42 11 23 97 61 34 48 75 88 75 82 6 14 84 97 38 95 2 22 42 10 78 63 30 18 69 19 0 32 71 1 71 84 41 85 7...

output:

50.12474114579368489331

result:

ok found '50.1247411', expected '50.1247411', error '0.0000000'

Test #41:

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

input:

2 2
76 36
68 77

output:

64.25000000000000000000

result:

ok found '64.2500000', expected '64.2500000', error '0.0000000'

Test #42:

score: 0
Accepted
time: 83ms
memory: 8220kb

input:

1000 1000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

0.00000000000000000000

result:

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

Test #43:

score: 0
Accepted
time: 124ms
memory: 8264kb

input:

1000 1000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 10...

output:

99.99999999999876365564

result:

ok found '100.0000000', expected '100.0000000', error '0.0000000'

Test #44:

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

input:

2 2
0 0
0 0

output:

0.00000000000000000000

result:

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

Test #45:

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

input:

2 2
100 100
100 100

output:

100.00000000000000000000

result:

ok found '100.0000000', expected '100.0000000', error '0.0000000'

Test #46:

score: 0
Accepted
time: 83ms
memory: 8168kb

input:

1000 1000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

0.00000100000000000006

result:

ok found '0.0000010', expected '0.0000010', error '0.0000000'

Test #47:

score: 0
Accepted
time: 118ms
memory: 8208kb

input:

1000 1000
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 10...

output:

99.99999899999875196954

result:

ok found '99.9999990', expected '99.9999990', error '0.0000000'

Extra Test:

score: 0
Extra Test Passed