結果

問題 No.48 ロボットの操縦
ユーザー Eclair1015
提出日時 2018-07-08 16:00:41
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 59,280 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-07 14:25:05
合計ジャッジ時間 1,171 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include<string>

using namespace std;
int main() {
	int x, y, l;
	int x_ori;
	int count = 0;
	cin >> x >> y >> l;

	if (0>x) {
		count++;
		x_ori = abs(x);
	} else {
		x_ori = x;
	}
	count += (x_ori / l);
	if (x_ori%l != 0) count++;
	//cout << count << "\n";

	if (y < 0) {
		if (x >= 0) {
			count += 2;
		} else {
			count++;
		}
		y = abs(y);
	} else {
		count++;
	}
	count += (y / l);
	if (y%l != 0) count++;
	cout << count << endl;

	return 0;
}

0