結果

問題 No.172 UFOを捕まえろ
ユーザー suppy193
提出日時 2015-05-28 10:56:38
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 191 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 23,936 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 12:05:51
合計ジャッジ時間 971 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:68: warning: implicit declaration of function ‘abs’ [-Wimplicit-function-declaration]
    8 |         printf("%d\n", (int)((sqrt(y * y * 2) + r) / sqrt(2) * 2 + abs(x - y) + 1));
      |                                                                    ^~~
main.c:3:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘abs’
    2 | #include <math.h>
  +++ |+#include <stdlib.h>
    3 | 
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d%d%d", &x, &y, &r);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <math.h>

int main(void) {
	int x, y, r;
	scanf("%d%d%d", &x, &y, &r);

	printf("%d\n", (int)((sqrt(y * y * 2) + r) / sqrt(2) * 2 + abs(x - y) + 1));
	return 0;
}
0