QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#215829#1778. Grazed GrainsPhantomThreshold#AC ✓264ms3812kbC++14574b2023-10-15 13:54:042023-10-15 13:54:05

Judging History

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

  • [2023-10-15 13:54:05]
  • 评测
  • 测评结果:AC
  • 用时:264ms
  • 内存:3812kb
  • [2023-10-15 13:54:04]
  • 提交

answer

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

typedef long double db;
const db step=0.01;

int n;
db x[50],y[50],r[50];

int main(){
	ios_base::sync_with_stdio(false);
	cin >> n;
	for (int i=1;i<=n;i++) cin >> x[i] >> y[i] >> r[i];
	
	db ans=0;
	for (db nowx=-10;nowx<=20;nowx+=step){
		for (db nowy=-10;nowy<=20;nowy+=step){
			bool flag=0;
			for (int i=1;i<=n;i++){
				if ((nowx-x[i])*(nowx-x[i])+(nowy-y[i])*(nowy-y[i])<=r[i]*r[i]){
					flag=1;
					break;
				}
			}
			if (flag) ans+=step*step;
		}
	}
	cout << ans << "\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 39ms
memory: 3772kb

input:

1
10 9 4

output:

50.2614

result:

ok found '50.26140', expected '50.26548', error '0.00008'

Test #2:

score: 0
Accepted
time: 44ms
memory: 3640kb

input:

2
6 10 10
6 4 8

output:

369.952

result:

ok found '369.95200', expected '369.96071', error '0.00002'

Test #3:

score: 0
Accepted
time: 59ms
memory: 3704kb

input:

3
5 6 9
0 1 9
2 2 8

output:

378.645

result:

ok found '378.64500', expected '378.66090', error '0.00004'

Test #4:

score: 0
Accepted
time: 74ms
memory: 3704kb

input:

4
6 1 10
1 8 3
5 8 7
10 10 10

output:

509.933

result:

ok found '509.93300', expected '509.94354', error '0.00002'

Test #5:

score: 0
Accepted
time: 113ms
memory: 3812kb

input:

5
4 9 5
3 2 3
10 7 7
9 3 6
5 8 8

output:

284.194

result:

ok found '284.19400', expected '284.20315', error '0.00003'

Test #6:

score: 0
Accepted
time: 116ms
memory: 3740kb

input:

6
6 7 6
0 5 10
9 6 3
2 0 4
2 10 5
8 1 7

output:

402.905

result:

ok found '402.90500', expected '402.91911', error '0.00004'

Test #7:

score: 0
Accepted
time: 126ms
memory: 3744kb

input:

7
4 2 8
10 1 9
0 2 2
5 10 4
10 3 10
6 4 7
9 1 4

output:

397.569

result:

ok found '397.56900', expected '397.58209', error '0.00003'

Test #8:

score: 0
Accepted
time: 159ms
memory: 3768kb

input:

8
9 7 7
2 10 9
6 8 3
5 6 4
6 3 1
6 7 4
0 6 3
7 4 6

output:

343.802

result:

ok found '343.80200', expected '343.81511', error '0.00004'

Test #9:

score: 0
Accepted
time: 152ms
memory: 3740kb

input:

9
5 2 8
10 9 9
6 5 4
5 10 5
7 2 4
5 5 1
5 7 5
0 0 8
3 8 1

output:

458.541

result:

ok found '458.54100', expected '458.55258', error '0.00003'

Test #10:

score: 0
Accepted
time: 199ms
memory: 3760kb

input:

10
2 6 2
9 0 4
1 9 2
1 1 1
7 4 7
0 3 10
8 7 9
3 0 7
5 5 4
4 1 9

output:

480.207

result:

ok found '480.20700', expected '480.22128', error '0.00003'

Test #11:

score: 0
Accepted
time: 192ms
memory: 3764kb

input:

10
1 2 7
1 0 4
1 1 1
3 1 10
0 0 3
3 0 3
2 1 10
2 1 5
1 0 8
3 0 8

output:

334.141

result:

ok found '334.14100', expected '334.15093', error '0.00003'

Test #12:

score: 0
Accepted
time: 175ms
memory: 3768kb

input:

10
4 3 5
1 3 6
6 0 9
3 0 7
1 6 10
0 5 3
1 0 10
0 1 8
2 6 10
0 2 1

output:

496.182

result:

ok found '496.18200', expected '496.19675', error '0.00003'

Test #13:

score: 0
Accepted
time: 264ms
memory: 3716kb

input:

10
8 6 1
5 3 1
4 6 1
7 0 1
5 7 1
10 7 1
3 7 1
4 0 1
10 4 1
3 1 1

output:

29.6956

result:

ok found '29.69560', expected '29.70354', error '0.00027'

Test #14:

score: 0
Accepted
time: 256ms
memory: 3708kb

input:

10
10 3 1
8 4 1
3 6 1
3 2 1
6 8 1
9 3 1
8 7 1
9 0 1
1 1 2
3 10 2

output:

47.4897

result:

ok found '47.48970', expected '47.50458', error '0.00031'

Test #15:

score: 0
Accepted
time: 56ms
memory: 3760kb

input:

2
0 0 1
10 10 1

output:

6.2814

result:

ok found '6.28140', expected '6.28319', error '0.00028'

Test #16:

score: 0
Accepted
time: 94ms
memory: 3812kb

input:

8
0 0 10
0 5 10
0 10 10
5 10 10
10 10 10
10 5 10
10 0 10
5 0 10

output:

809.932

result:

ok found '809.93200', expected '809.95264', error '0.00003'

Test #17:

score: 0
Accepted
time: 239ms
memory: 3704kb

input:

10
3 4 5
3 4 5
3 4 5
3 4 5
3 4 5
3 4 5
3 4 5
3 4 5
3 4 5
3 4 5

output:

78.5333

result:

ok found '78.53330', expected '78.53982', error '0.00008'

Test #18:

score: 0
Accepted
time: 258ms
memory: 3740kb

input:

10
0 0 1
0 0 1
0 0 1
0 0 1
0 10 1
0 10 1
10 0 1
10 0 1
10 10 1
10 10 1

output:

12.5628

result:

ok found '12.56280', expected '12.56637', error '0.00028'

Test #19:

score: 0
Accepted
time: 86ms
memory: 3712kb

input:

10
0 0 10
10 0 10
0 10 10
10 10 10
0 3 10
0 7 10
3 0 10
7 0 10
10 5 10
5 10 10

output:

811.043

result:

ok found '811.04300', expected '811.06784', error '0.00003'

Test #20:

score: 0
Accepted
time: 92ms
memory: 3660kb

input:

4
0 0 4
0 10 4
10 0 4
10 10 4

output:

201.046

result:

ok found '201.04600', expected '201.06193', error '0.00008'

Test #21:

score: 0
Accepted
time: 256ms
memory: 3660kb

input:

10
0 0 1
0 2 1
0 4 1
0 6 1
0 8 1
0 10 1
10 0 1
10 2 1
10 4 1
10 6 1

output:

31.4066

result:

ok found '31.40660', expected '31.41593', error '0.00030'