結果

問題 No.419 直角三角形
コンテスト
ユーザー notetonous
提出日時 2016-09-10 00:18:03
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 338 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 128 ms
コンパイル使用メモリ 29,696 KB
最終ジャッジ日時 2026-02-23 22:21:03
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:15:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |   scanf("%d %d",&a,&b);
      |   ^~~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>
#include <math.h>
int min(int a,int b){
  return a<b?a:b;
}
int max(int a,int b){
  return a<b?b:a;
}
double min2(double a,double b){
  return a<b?a:b;
}
int main(){
  int a,b;
  int l1,l2;
  scanf("%d %d",&a,&b);
  l1=min(a,b);
  l2=max(a,b);
  printf("%lf\n",min2(sqrt(l1*l1+l2*l2),sqrt(l2*l2-l1*l1)));
  return 0;
}
0