ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1490. Fire Circle

Why WA 7
Posted by Razvan Brezulianu 25 Sep 2008 14:41
i dont know why i ahve got WA7

Here is my code(pls help me :D)

#include<stdio.h>
#include<math.h>

long i, j, r;
unsigned long nr;

int main()
{
    scanf("%ld", &r);

    for(i = 1; i <= r; i++)
        for(j = 1; j <= r; j++)
            if((double)(sqrt(i * i + j * j) - r) >= sqrt(2))
                nr++;

    nr = r * r * 4 - nr * 4;

    printf("%ld\n", nr);

    return 0;
}

Edited by author 25.09.2008 14:42