Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int solution(int N) {
- // write your code in C++14 (g++ 6.2.0)
- int count=0;
- for (int x=0;x<=N;x++)
- {
- for (int y=0; y<=N;y++)
- {
- if(x*x+y*y<=N*N) count++;
- }
- }
- return (4*count-4*N-3);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement