結果

問題 No.48 ロボットの操縦
ユーザー shiratama
提出日時 2016-08-14 01:28:01
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 58,712 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-07 16:37:49
合計ジャッジ時間 1,491 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>

auto main() -> int {
	double X, Y, L;
	std::cin >> X >> Y >> L;

	int n_orders = 0;
	if (Y == 0) {
		if (X != 0) {
			n_orders += 1;
			n_orders += std::ceil(std::abs(X) / L);
		}
	} else if (Y > 0) {
		n_orders += std::ceil(Y / L);
		if (X != 0) {
			n_orders += 1;
			n_orders += std::ceil(std::abs(X) / L);
		}
	} else if (Y < 0) {
		n_orders += 1;
		n_orders += std::ceil(Y / L);
		n_orders += 1;
		n_orders += std::ceil(std::abs(X) / L);
	}

	std::cout << n_orders << std::endl;
}
0