結果

問題 No.419 直角三角形
ユーザー iicafiaxus
提出日時 2016-09-09 22:36:39
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 473 bytes
コンパイル時間 2,514 ms
コンパイル使用メモリ 168,136 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 04:15:24
合計ジャッジ時間 3,199 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;

void main(){
	int a, b;
	{
		int[] tmp = readln.chomp.split.map!(to!int).array();
		a = tmp[0], b = tmp[1];
		}
	
	real ans;
	if(a < b){
		ans = sqrt(cast(real)(b * b - a * a));
		}
	else if(a == b){
		ans = sqrt(cast(real)(a * a + b * b));
		}
	else{
		ans = sqrt(cast(real)(a * a - b * b));
		}
	
	writefln("%4.8f", ans);
	}
0