結果

問題 No.48 ロボットの操縦
ユーザー TSaito
提出日時 2022-06-12 04:00:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 271 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 64,528 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 14:17:28
合計ジャッジ時間 1,241 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
int main()
{
	int X,Y,L;
	cin >> X >> Y >> L;
	int op=0;
	if(Y<0){
		op = 2;
		Y *= -1;
	}else if(X>0 || X<0){
		op = 1;
	}
	if(X<0) X*= -1;
	op += X / L + (int)(X % L > 0);
	op += Y / L + (int)(Y % L > 0);
	cout << op << endl;
}
0