結果
問題 | No.419 直角三角形 |
ユーザー |
![]() |
提出日時 | 2016-09-09 22:30:05 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 1,107 ms |
コンパイル使用メモリ | 157,928 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-16 10:23:40 |
合計ジャッジ時間 | 1,771 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | scanf("%lf %lf", &a, &b); | ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; #define DPRINTF(...) printf(__VA_ARGS_) #define FOR0(i, n) for(int i=0;i<=n;i++) #define ALL(c) (begin(c)), (end(c)) #define fst(t) get<0>(t) #define snd(t) get<1>(t) #define thd(t) get<2>(t) typedef long long ll; int main(){ double a, b; scanf("%lf %lf", &a, &b); printf("%.10f\n", sqrt(min(a == b ? 1e9 : abs(a * a - b * b), abs(a * a + b * b)))); }