結果

問題 No.94 圏外です。(EASY)
ユーザー AoiroFukurou
提出日時 2016-12-18 15:48:09
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 719 bytes
コンパイル時間 3,711 ms
コンパイル使用メモリ 77,104 KB
実行使用メモリ 58,828 KB
最終ジャッジ日時 2024-12-14 08:25:42
合計ジャッジ時間 8,907 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 18 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class No_94 {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	if(N == 0 ){
		System.out.println(1);
		return;
	}
	int[] x = new int[N];
	int[] y = new int[N];
	for(int i = 0; i < N; i++){
		x[i] = sc.nextInt();
		y[i] = sc.nextInt();
	}
	double tmp = Math.sqrt(Math.pow(x[0] - x[1], 2) + Math.pow(y[0] - y[1], 2));
	for(int i = 0; i < N - 1; i++){
		for(int j = i + 1; j < N; j++){
			double d = Math.sqrt(Math.pow(x[i] - x[j], 2) + Math.pow(y[i] - y[j], 2));
			if(d > tmp){
				tmp = d;
			}
		}
	}
	if(tmp > 10.0){
		System.out.println(2);
	}else{
		double ans = tmp + 2.0;
		System.out.println(ans);
	}
}
}
0