結果

問題 No.48 ロボットの操縦
ユーザー soy
提出日時 2019-07-28 15:30:19
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 289 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 54,588 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-02 15:02:26
合計ジャッジ時間 1,072 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
	long long int x, y, l,ans=0;
	cin >> x >> y >> l;
	if (y < 0) {
		if (x== 0)
			ans += 2;
		else
			ans += 1;
	}
	x = abs(x);
	y = abs(y);
	ans += y / l + (y % l != 0);
	ans += (x != 0) + x / l + (x % l != 0);
	cout << ans << "\n";
}
0