結果
問題 |
No.94 圏外です。(EASY)
|
ユーザー |
![]() |
提出日時 | 2016-12-18 15:43:50 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 719 bytes |
コンパイル時間 | 4,337 ms |
コンパイル使用メモリ | 77,440 KB |
実行使用メモリ | 57,448 KB |
最終ジャッジ日時 | 2024-12-14 08:25:33 |
合計ジャッジ時間 | 9,172 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 18 RE * 1 |
ソースコード
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); } } }