結果
| 問題 |
No.419 直角三角形
|
| コンテスト | |
| ユーザー |
okayunonaha
|
| 提出日時 | 2016-09-17 15:25:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 340 bytes |
| コンパイル時間 | 542 ms |
| コンパイル使用メモリ | 58,712 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-17 08:17:24 |
| 合計ジャッジ時間 | 1,454 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:9: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
20 | printf("%.10f\n", sqrt(ans));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
typedef long long ll;
#define int ll
signed main(void) {
double a, b, ans;
cin >> a >> b;
if (a > b) {
ans = a*a - b*b;
} else if (a < b) {
ans = b*b - a*a;
} else if (a == b) {
ans = a*a;
}
printf("%.10f\n", sqrt(ans));
return 0;
}
okayunonaha