Submission #23088


Source Code Expand

Copy
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int p[][]=new int[n][2];
		for(int i=0;i<n;i++){
			p[i][0]=sc.nextInt();
			p[i][1]=sc.nextInt();
		}
		double ans=0;
		for(int i=0;i<n;i++){
			for(int j=i+1;j<n;j++){
				ans=Math.max(ans, Math.sqrt(Math.pow(p[i][0]-p[j][0], 2)+Math.pow(p[i][1]-p[j][1], 2)));
			}
		}
		System.out.println(ans);
	}
}

Submission Info

Submission Time
Task A - 2点間距離の最大値 ( The longest distance )
User hoshi524
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 474 Byte
Status
Exec Time 669 ms
Memory 22108 KB

Judge Result

Set Name Score / Max Score Test Cases
All 100 / 100 00_max.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rnd_00.txt, 01_rnd_01.txt, 01_rnd_02.txt, 01_rnd_03.txt, 01_rnd_04.txt, 01_rnd_05.txt, 01_rnd_06.txt, 01_rnd_07.txt, 01_rnd_08.txt, 01_rnd_09.txt, 01_rnd_10.txt, 01_rnd_11.txt, 01_rnd_12.txt, 01_rnd_13.txt, 01_rnd_14.txt, 01_rnd_15.txt, 01_rnd_16.txt, 01_rnd_17.txt, 01_rnd_18.txt, 01_rnd_19.txt
Case Name Status Exec Time Memory
00_max.txt 411 ms 19792 KB
00_sample_01.txt 459 ms 19884 KB
00_sample_02.txt 423 ms 19760 KB
00_sample_03.txt 436 ms 19788 KB
00_sample_04.txt 420 ms 19920 KB
00_sample_05.txt 402 ms 19816 KB
01_rnd_00.txt 443 ms 22064 KB
01_rnd_01.txt 463 ms 21848 KB
01_rnd_02.txt 669 ms 21940 KB
01_rnd_03.txt 417 ms 21968 KB
01_rnd_04.txt 420 ms 21812 KB
01_rnd_05.txt 471 ms 22092 KB
01_rnd_06.txt 468 ms 21920 KB
01_rnd_07.txt 447 ms 21812 KB
01_rnd_08.txt 473 ms 21812 KB
01_rnd_09.txt 657 ms 21720 KB
01_rnd_10.txt 466 ms 22108 KB
01_rnd_11.txt 490 ms 21964 KB
01_rnd_12.txt 419 ms 21720 KB
01_rnd_13.txt 428 ms 21572 KB
01_rnd_14.txt 431 ms 21848 KB
01_rnd_15.txt 439 ms 21812 KB
01_rnd_16.txt 423 ms 22056 KB
01_rnd_17.txt 421 ms 21976 KB
01_rnd_18.txt 397 ms 21852 KB
01_rnd_19.txt 429 ms 21976 KB