結果
| 問題 |
No.410 出会い
|
| ユーザー |
|
| 提出日時 | 2016-11-15 07:43:54 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 263 bytes |
| コンパイル時間 | 170 ms |
| コンパイル使用メモリ | 21,248 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 11:18:55 |
| 合計ジャッジ時間 | 951 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%d%d",&px,&py);
| ^~~~~~~~~~~~~~~~~~~~~
main.c:12:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%d%d",&qx,&qy);
| ^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h>
int dist(int x,int y){
if(x>y){return x-y;}
else{return y-x;}
}
int main(void){
int px,py,qx,qy,a,b;
double r;
scanf("%d%d",&px,&py);
scanf("%d%d",&qx,&qy);
a = dist(px,qx);
b = dist(py,qy);
r = a+b;
printf("%lf\n",r/2);
return 0;
}