結果

問題 No.48 ロボットの操縦
ユーザー umaumax
提出日時 2017-05-05 01:05:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 297 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 60,760 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-14 07:18:36
合計ジャッジ時間 1,343 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <iostream>

using namespace std;

int main(int argc, const char* argv[])
{
	int X, Y, L;
	cin >> X >> Y >> L;
	int cnt = 0;
	if (X != 0 && Y >= 0) cnt++;
	if (Y < 0) cnt += 2;
	cnt += (abs(X) + L - 1) / L;
	cnt += (abs(Y) + L - 1) / L;
	cout << cnt << endl;
	return 0;
}
0