Submission #20244394


Source Code Expand

Copy
#include<iostream>
#include<cmath>

using namespace std;

typedef long long ll;
 
int main(){
    long double X, Y, R;
    cin >> X >> Y >> R;
    R += (long double)4.0 * 1e-14;
    ll ans = 0;
    const ll from = ceil(X - R), to = floor(X + R);
    for(ll x = from; x <= to; x++){
        const long double range = sqrt(R * R - (X - x) * (X - x));
        const ll from = ceil(Y - range), to = floor(Y + range);
        ans += to - from + 1;
    }
    cout << ans << endl;
}

Submission Info

Submission Time
Task D - Circle Lattice Points
User Sen
Language C++ (GCC 9.2.1)
Score 0
Code Size 494 Byte
Status WA
Exec Time 15 ms
Memory 3676 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 3
AC × 44
WA × 2
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All extreme_00.txt, extreme_01.txt, extreme_02.txt, extreme_03.txt, handmade_00.txt, handmade_01.txt, handmade_02.txt, handmade_marginal_00.txt, handmade_marginal_01.txt, handmade_marginal_02.txt, handmade_marginal_03.txt, handmade_marginal_04.txt, handmade_marginal_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_integer_00.txt, random_integer_01.txt, random_integer_02.txt, random_integer_03.txt, random_integer_04.txt, random_integer_05.txt, random_integer_06.txt, random_integer_07.txt, random_integer_08.txt, random_integer_09.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
extreme_00.txt AC 15 ms 3516 KB
extreme_01.txt AC 14 ms 3580 KB
extreme_02.txt AC 15 ms 3592 KB
extreme_03.txt AC 12 ms 3520 KB
handmade_00.txt AC 2 ms 3668 KB
handmade_01.txt AC 2 ms 3656 KB
handmade_02.txt AC 2 ms 3556 KB
handmade_marginal_00.txt AC 14 ms 3596 KB
handmade_marginal_01.txt WA 14 ms 3596 KB
handmade_marginal_02.txt AC 11 ms 3668 KB
handmade_marginal_03.txt AC 12 ms 3532 KB
handmade_marginal_04.txt AC 12 ms 3676 KB
handmade_marginal_05.txt WA 12 ms 3588 KB
random_00.txt AC 9 ms 3592 KB
random_01.txt AC 4 ms 3588 KB
random_02.txt AC 12 ms 3596 KB
random_03.txt AC 9 ms 3524 KB
random_04.txt AC 8 ms 3592 KB
random_05.txt AC 2 ms 3584 KB
random_06.txt AC 15 ms 3652 KB
random_07.txt AC 5 ms 3676 KB
random_08.txt AC 7 ms 3520 KB
random_09.txt AC 13 ms 3596 KB
random_10.txt AC 10 ms 3592 KB
random_11.txt AC 4 ms 3532 KB
random_12.txt AC 9 ms 3544 KB
random_13.txt AC 14 ms 3536 KB
random_14.txt AC 8 ms 3536 KB
random_15.txt AC 7 ms 3532 KB
random_16.txt AC 6 ms 3536 KB
random_17.txt AC 11 ms 3580 KB
random_18.txt AC 10 ms 3604 KB
random_19.txt AC 7 ms 3592 KB
random_integer_00.txt AC 6 ms 3596 KB
random_integer_01.txt AC 11 ms 3520 KB
random_integer_02.txt AC 15 ms 3600 KB
random_integer_03.txt AC 9 ms 3540 KB
random_integer_04.txt AC 7 ms 3592 KB
random_integer_05.txt AC 3 ms 3536 KB
random_integer_06.txt AC 7 ms 3672 KB
random_integer_07.txt AC 8 ms 3524 KB
random_integer_08.txt AC 5 ms 3648 KB
random_integer_09.txt AC 12 ms 3668 KB
sample_01.txt AC 2 ms 3668 KB
sample_02.txt AC 2 ms 3592 KB
sample_03.txt AC 11 ms 3600 KB