結果
| 問題 |
No.410 出会い
|
| ユーザー |
cb_4150
|
| 提出日時 | 2017-08-16 22:42:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 257 bytes |
| コンパイル時間 | 202 ms |
| コンパイル使用メモリ | 23,296 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 11:24:15 |
| 合計ジャッジ時間 | 816 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d %d", &ax, &ay);
| ~~~~~^~~~~~~~~~~~~~~~~~~
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d %d", &bx, &by);
| ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>
int main() {
int ax, ay, bx, by;
scanf("%d %d", &ax, &ay);
scanf("%d %d", &bx, &by);
ax = bx - ax;
ay = by - ay;
if (ax < 0) ax *= -1;
if (ay < 0) ay *= -1;
double res = (ax + ay) / 2.0;
printf("%.20lf\n", res);
return 0;
}
cb_4150