結果

問題 No.48 ロボットの操縦
ユーザー Mcpu3Mcpu3
提出日時 2018-05-01 23:25:59
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 250 bytes
コンパイル時間 1,678 ms
コンパイル使用メモリ 28,064 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-10 08:48:08
合計ジャッジ時間 1,735 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 0 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
4,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 0 ms
4,380 KB
testcase_17 AC 0 ms
4,380 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 0 ms
4,380 KB
testcase_24 AC 0 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:8:13: 警告: 関数 ‘abs’ の暗黙的な宣言です [-Wimplicit-function-declaration]
    8 |         t = abs(x) + abs(y);
      |             ^~~
main.c:3:1: 備考: include ‘<stdlib.h>’ or provide a declaration of ‘abs’
    2 | #include <math.h>
  +++ |+#include <stdlib.h>
    3 | 

ソースコード

diff #

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

int main(void)
{
	int x, y, l, s = 0, t;
	scanf("%d\n%d\n%d", &x, &y, &l);
	t = abs(x) + abs(y);
	x != 0 ? s++ : 0;
	y < 0 ? s += 2 : 0;
	s += t / l;
	t%l ? s++ : 0;
	printf("%d\n", s);
	return 0;
}
0