結果

問題 No.172 UFOを捕まえろ
ユーザー suppy193
提出日時 2015-05-28 10:57:54
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 201 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 23,936 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 12:05:58
合計ジャッジ時間 991 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(abs(x) - abs(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(abs(x) - abs(y)) + 1));
	return 0;
}
0