結果
問題 |
No.419 直角三角形
|
ユーザー |
|
提出日時 | 2016-09-15 22:42:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 256 bytes |
コンパイル時間 | 307 ms |
コンパイル使用メモリ | 39,808 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 06:15:53 |
合計ジャッジ時間 | 1,122 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d%d", &a, &b); | ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <cmath> #include <cstdio> #include <algorithm> #define rep(i, n) for(int i = 0; i < (n); ++i) using namespace std; int a, b; int main(){ scanf("%d%d", &a, &b); if(a > b){ swap(a, b); } printf("%.8lf\n", sqrt(b * b - a * a)); return 0; }