Submission #5992838


Source Code Expand

using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
    static void Main(string[] args)
    {
		int N = int.Parse(Console.ReadLine());
		double[] x = new double[N];
		double[] y = new double[N];
        for(int i = 0; i < N; i++)
		{
			string[] input = Console.ReadLine().Split(' ');
			x[i] = double.Parse(input[0]);
			y[i] = double.Parse(input[1]);
		}
		//入力

		List<double> dis = new List<double>();
        for(int i = 0; i < N-1; i++)
		{

			for (int j = i + 1; j < N; j++)
			{
				double d = Math.Sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
				dis.Add(d);

			}
		}

		dis.Sort((a, b) => b - a);
		Console.WriteLine(dis[0]);
        
	}
}

Submission Info

Submission Time
Task A - 2点間距離の最大値 ( The longest distance )
User eSeF
Language C# (Mono 4.6.2.0)
Score 0
Code Size 847 Byte
Status CE

Compile Error

./Main.cs(35,22): error CS0266: Cannot implicitly convert type `double' to `int'. An explicit conversion exists (are you missing a cast?)
./Main.cs(35,22): error CS1662: Cannot convert `lambda expression' to delegate type `System.Comparison<double>' because some of the return types in the block are not implicitly convertible to the delegate return type