結果
問題 | No.419 直角三角形 |
ユーザー |
![]() |
提出日時 | 2016-11-20 00:14:09 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 275 bytes |
コンパイル時間 | 117 ms |
コンパイル使用メモリ | 23,040 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 03:11:57 |
合計ジャッジ時間 | 933 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d %d", &a, &b); | ^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <math.h>int main() {int a, b;scanf("%d %d", &a, &b);double ans;if (a == b) ans = a * sqrt(2.0);else {int big = a > b ? a : b, small = a < b ? a : b;ans = sqrt(big * big - small * small);}printf("%.7lf\n", ans);return 0;}