結果

問題 No.48 ロボットの操縦
ユーザー A63295A63295
提出日時 2016-01-05 22:15:12
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 265 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 21,020 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 15:22:21
合計ジャッジ時間 1,113 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 WA -
testcase_03 AC 0 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 0 ms
4,348 KB
testcase_09 AC 0 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 0 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 0 ms
4,348 KB
testcase_15 AC 0 ms
4,348 KB
testcase_16 AC 0 ms
4,348 KB
testcase_17 AC 0 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 1 ms
4,348 KB
testcase_21 AC 0 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 0 ms
4,348 KB
testcase_24 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 | scanf ("%d%d%d", &X, &Y, &L);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(void){
int X, Y, L;
int i = 0;
scanf ("%d%d%d", &X, &Y, &L);
if ( X != 0){
	i++;
	if ( X < 0)
		X *= -1;
}
if ( Y < 0){
	i++;
	Y *= -1;
}
i += X / L;
i += Y / L;
if ( X % L > 0)
	i++;
if ( Y % L > 0)
	i++;
printf ( "%d", i);
	return 0;
}
0