結果

問題 No.48 ロボットの操縦
ユーザー Drafear
提出日時 2016-01-18 03:40:37
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 255 bytes
コンパイル時間 1,349 ms
コンパイル使用メモリ 157,784 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 18:32:45
合計ジャッジ時間 1,881 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
	int X, Y, L; cin >> X >> Y >> L;
	int ans = 0;
	if (Y >= 0) {
		if (X != 0) ++ans;
	}
	else {
		ans += 2;
	}
	X = abs(X), Y = abs(Y);
	ans += (X+L-1) / L + (Y+L-1) / L;
	cout << ans << endl;
}
0