QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#816911#1778. Grazed Grainsucup-team3723#AC ✓133ms4060kbC++17695b2024-12-16 19:08:312024-12-16 19:08:31

Judging History

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

  • [2024-12-16 19:08:31]
  • 评测
  • 测评结果:AC
  • 用时:133ms
  • 内存:4060kb
  • [2024-12-16 19:08:31]
  • 提交

answer

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> x(n), y(n), r(n);
    for (int i = 0; i < n; ++i) cin >> x[i] >> y[i] >> r[i];
    double d = 1e-2, ans = 0;
    for (double i = -10; i <= 20; i += d)
    {
        for (double j = -10; j <= 20; j += d)
        {
            for (int k = 0; k < n; ++k)
            {
                double dx = x[k] - i, dy = y[k] - j;
                if (dx * dx + dy * dy <= r[k] * r[k])
                {
                    ans += d * d;
                    break;
                }
            }
        }
    }
    printf("%.10f\n", ans);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 17ms
memory: 3888kb

input:

1
10 9 4

output:

50.2617000005

result:

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

Test #2:

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

input:

2
6 10 10
6 4 8

output:

369.9529999788

result:

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

Test #3:

score: 0
Accepted
time: 34ms
memory: 3700kb

input:

3
5 6 9
0 1 9
2 2 8

output:

378.6461999766

result:

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

Test #4:

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

input:

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

output:

509.9336999436

result:

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

Test #5:

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

input:

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

output:

284.1942000003

result:

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

Test #6:

score: 0
Accepted
time: 57ms
memory: 3848kb

input:

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

output:

402.9065999705

result:

ok found '402.90660', expected '402.91911', error '0.00003'

Test #7:

score: 0
Accepted
time: 66ms
memory: 4060kb

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

result:

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

Test #8:

score: 0
Accepted
time: 78ms
memory: 3848kb

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

result:

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

Test #9:

score: 0
Accepted
time: 80ms
memory: 3916kb

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

result:

ok found '458.54160', expected '458.55258', error '0.00002'

Test #10:

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

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

result:

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

Test #11:

score: 0
Accepted
time: 99ms
memory: 3952kb

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

result:

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

Test #12:

score: 0
Accepted
time: 89ms
memory: 3844kb

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

result:

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

Test #13:

score: 0
Accepted
time: 132ms
memory: 4052kb

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

result:

ok found '29.69630', expected '29.70354', error '0.00024'

Test #14:

score: 0
Accepted
time: 132ms
memory: 3844kb

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

result:

ok found '47.49060', expected '47.50458', error '0.00029'

Test #15:

score: 0
Accepted
time: 30ms
memory: 3700kb

input:

2
0 0 1
10 10 1

output:

6.2814000000

result:

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

Test #16:

score: 0
Accepted
time: 50ms
memory: 3700kb

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

result:

ok found '809.93250', expected '809.95264', error '0.00002'

Test #17:

score: 0
Accepted
time: 124ms
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.5337000015

result:

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

Test #18:

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

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

result:

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

Test #19:

score: 0
Accepted
time: 43ms
memory: 3844kb

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

result:

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

Test #20:

score: 0
Accepted
time: 51ms
memory: 3656kb

input:

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

output:

201.0462000056

result:

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

Test #21:

score: 0
Accepted
time: 132ms
memory: 3700kb

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

result:

ok found '31.40710', expected '31.41593', error '0.00028'