結果

問題 No.48 ロボットの操縦
ユーザー hanorver
提出日時 2015-09-06 22:20:54
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 53,852 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 04:44:37
合計ジャッジ時間 1,205 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

int main() {
	int x, y, l, count = 0;
	std::cin >> x >> y >> l;

	if(x != 0){
		count++;//左か右への回転
		count += abs(x) / l + 1;
		if (x%l == 0)count--;
	}

	if(y != 0){
		count += abs(y) / l + 1;
		if (y%l == 0)count--;
	}

	if (y < 0)count += 2;

	std::cout << count << std::endl;
	return 0;
}
0