結果
問題 |
No.419 直角三角形
|
ユーザー |
![]() |
提出日時 | 2016-09-11 01:12:48 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 398 bytes |
コンパイル時間 | 1,985 ms |
コンパイル使用メモリ | 75,300 KB |
実行使用メモリ | 41,624 KB |
最終ジャッジ日時 | 2024-11-17 00:10:50 |
合計ジャッジ時間 | 5,575 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 3 |
ソースコード
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); } } }