結果

問題 No.419 直角三角形
ユーザー manini
提出日時 2016-09-11 01:13:55
言語 Java
(openjdk 23)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 398 bytes
コンパイル時間 2,314 ms
コンパイル使用メモリ 74,036 KB
実行使用メモリ 41,680 KB
最終ジャッジ日時 2024-11-17 00:10:57
合計ジャッジ時間 5,543 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		long a=s.nextInt();
		long b=s.nextInt();
		if(a!=b){
		long max=Math.max(a, b);
		long min=Math.min(a, b);
		
		double c=Math.sqrt((double)max*max-min*min);
		System.out.println(c);
		}else{
			double c=Math.sqrt((double)a*a+b*b);
			System.out.println(c);
		}
	}
}
0