結果
問題 | No.419 直角三角形 |
ユーザー |
|
提出日時 | 2020-04-28 20:37:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 254 bytes |
コンパイル時間 | 2,126 ms |
コンパイル使用メモリ | 192,636 KB |
最終ジャッジ日時 | 2025-01-10 02:56:42 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | int b,c; scanf("%d%d",&b,&c); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>#define rep(i,n) for(int i=0;i<(n);i++)using namespace std;int main(){int b,c; scanf("%d%d",&b,&c);if(b==c){printf("%.9f\n",sqrt(2)*b);}else{if(b>c) swap(b,c);printf("%.9f\n",sqrt(c*c-b*b));}return 0;}