結果

問題 No.48 ロボットの操縦
ユーザー TSaito
提出日時 2022-06-12 03:55:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 250 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 64,024 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-22 14:14:33
合計ジャッジ時間 1,332 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4 WA * 21
権限があれば一括ダウンロードができます

ソースコード

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 + X % L;
	op += Y / L + Y % L;
	cout << op << endl;
}
0