結果

問題 No.48 ロボットの操縦
ユーザー ken
提出日時 2018-03-16 18:32:26
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 367 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 28,544 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-21 14:37:12
合計ジャッジ時間 1,430 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main(void){
	int x, y, l, cnt = 0;
	scanf("%d%d%d", &x, &y, &l);
	if(x < 0){
		x *= -1;
	}
	if(y < 0){
		y *= -1;
	}
	if(x % l == 0){
		cnt += x / l;
	}else{
		cnt += (x / l) + 1;
	}
	if(y % l == 0){
		cnt += y / l;
	}else{
		cnt += (y / l) + 1;
	}
	if(x == 0 || y == 0){
		printf("%d\n", cnt);
	}else{
		printf("%d\n", cnt + 1);
	}
	return 0;
}
0