結果

問題 No.94 圏外です。(EASY)
ユーザー kuuso1kuuso1
提出日時 2014-12-07 21:12:01
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,664 bytes
コンパイル時間 3,377 ms
コンパイル使用メモリ 106,400 KB
実行使用メモリ 35,920 KB
最終ジャッジ日時 2023-09-02 10:36:25
合計ジャッジ時間 46,288 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
24,656 KB
testcase_01 AC 63 ms
24,676 KB
testcase_02 AC 63 ms
24,792 KB
testcase_03 WA -
testcase_04 AC 70 ms
22,580 KB
testcase_05 AC 99 ms
24,596 KB
testcase_06 AC 199 ms
24,696 KB
testcase_07 AC 503 ms
22,688 KB
testcase_08 AC 1,335 ms
26,560 KB
testcase_09 AC 4,130 ms
33,740 KB
testcase_10 AC 4,133 ms
31,728 KB
testcase_11 AC 4,112 ms
33,440 KB
testcase_12 AC 4,187 ms
33,752 KB
testcase_13 AC 4,211 ms
33,724 KB
testcase_14 AC 4,177 ms
32,144 KB
testcase_15 AC 4,170 ms
33,856 KB
testcase_16 AC 4,173 ms
34,184 KB
testcase_17 AC 4,317 ms
33,940 KB
testcase_18 AC 4,363 ms
35,920 KB
testcase_19 AC 4,208 ms
33,428 KB
testcase_20 AC 63 ms
22,532 KB
testcase_21 AC 64 ms
22,564 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int INF=N*2;
		
		int[][] WF=new int[N][];
		for(int i=0;i<N;i++){
			WF[i]=new int[N];
			for(int j=0;j<N;j++){
				WF[i][j]=(X[i]-X[j])*(X[i]-X[j])+(Y[i]-Y[j])*(Y[i]-Y[j])<=100?1:INF;
			}
			WF[i][i]=0;
		}
		
		for(int k=0;k<N;k++){
			for(int i=0;i<N;i++){
				for(int j=i+1;j<N;j++){
					WF[i][j]=WF[j][i]=Math.Min(WF[i][j],WF[i][k]+WF[k][j]);
				}
			}
		}
		
		List<int> D=new List<int>();
		for(int i=0;i<N;i++){
			for(int j=i+1;j<N;j++){
				if(WF[i][j]!=INF)D.Add((X[i]-X[j])*(X[i]-X[j])+(Y[i]-Y[j])*(Y[i]-Y[j]));
			}
		}
		
		int max=0;
		for(int i=0;i<D.Count;i++){
			max=Math.Max(max,D[i]);
		}
		Console.WriteLine(2+Math.Sqrt(max));
		
		
	}
	int N;
	int[] X;
	int[] Y;
	public Sol(){
		N=ri();
		X=new int[N];
		Y=new int[N];
		for(int i=0;i<N;i++){
			var d=ria();
			X[i]=d[0];Y[i]=d[1];
		}
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0