Submission #707846


Source Code Expand

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//using System.Drawing;

namespace AtCoder
{
    class Point {
        public int X;
        public int Y;
        public Point(int x, int y) {
            X = x;
            Y = y;
        }
    }
    class ARC051
    {
        static void Main(string[] args) {
            string[] spl = Console.ReadLine().Split(' ');
            int x1 = int.Parse(spl[0]);
            int y1 = int.Parse(spl[1]);
            int r = int.Parse(spl[2]);
            spl = Console.ReadLine().Split(' ');
            int x2 = int.Parse(spl[0]);
            int y2 = int.Parse(spl[1]);
            int x3 = int.Parse(spl[2]);
            int y3 = int.Parse(spl[3]);

            Point[] corner = new Point[] {
                new Point(x2, y2),
                new Point(x3, y2),
                new Point(x2, y3),
                new Point(x3, y3),
            };
            string existsBlue = "NO";
            foreach(Point p in corner) {
                if((p.X - x1) * (p.X - x1) + (p.Y - y1) * (p.Y - y1) > r * r) {
                    existsBlue = "YES";
                }
            }

            string existsRed = "NO";
            foreach (Point p in corner) {
                if (x1 - r < x2 ||
                    x1 + r > x3 ||
                    y1 - r < y2 ||
                    y1 + r > y3) {
                    existsRed = "YES";
                }
            }
            
            Console.WriteLine(existsRed);
            Console.WriteLine(existsBlue);
        }
    }
}

Submission Info

Submission Time
Task A - 塗り絵
User butz
Language C# (Mono 4.6.2.0)
Score 100
Code Size 1660 Byte
Status AC
Exec Time 33 ms
Memory 2776 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 5
AC × 35
Set Name Test Cases
Sample example_0.txt, example_1.txt, example_2.txt, example_3.txt, example_4.txt
All blue_0.txt, blue_1.txt, blue_2.txt, blue_3.txt, blue_4.txt, blue_5.txt, blue_6.txt, blue_7.txt, blue_8.txt, blue_9.txt, example_0.txt, example_1.txt, example_2.txt, example_3.txt, example_4.txt, random_0.txt, random_1.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt, red_0.txt, red_1.txt, red_2.txt, red_3.txt, red_4.txt, red_5.txt, red_6.txt, red_7.txt, red_8.txt, red_9.txt
Case Name Status Exec Time Memory
blue_0.txt AC 33 ms 2776 KiB
blue_1.txt AC 31 ms 2648 KiB
blue_2.txt AC 30 ms 2648 KiB
blue_3.txt AC 32 ms 2648 KiB
blue_4.txt AC 33 ms 2648 KiB
blue_5.txt AC 31 ms 2648 KiB
blue_6.txt AC 30 ms 2648 KiB
blue_7.txt AC 31 ms 2648 KiB
blue_8.txt AC 31 ms 2648 KiB
blue_9.txt AC 33 ms 2648 KiB
example_0.txt AC 31 ms 2648 KiB
example_1.txt AC 30 ms 2648 KiB
example_2.txt AC 33 ms 2648 KiB
example_3.txt AC 32 ms 2648 KiB
example_4.txt AC 31 ms 2648 KiB
random_0.txt AC 31 ms 2648 KiB
random_1.txt AC 32 ms 2648 KiB
random_2.txt AC 30 ms 2648 KiB
random_3.txt AC 33 ms 2648 KiB
random_4.txt AC 33 ms 2648 KiB
random_5.txt AC 31 ms 2648 KiB
random_6.txt AC 32 ms 2648 KiB
random_7.txt AC 33 ms 2648 KiB
random_8.txt AC 31 ms 2648 KiB
random_9.txt AC 31 ms 2648 KiB
red_0.txt AC 32 ms 2648 KiB
red_1.txt AC 32 ms 2648 KiB
red_2.txt AC 31 ms 2648 KiB
red_3.txt AC 30 ms 2648 KiB
red_4.txt AC 30 ms 2648 KiB
red_5.txt AC 30 ms 2648 KiB
red_6.txt AC 31 ms 2648 KiB
red_7.txt AC 30 ms 2648 KiB
red_8.txt AC 30 ms 2648 KiB
red_9.txt AC 32 ms 2648 KiB