結果

問題 No.48 ロボットの操縦
ユーザー shiratama
提出日時 2016-08-13 18:43:13
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 768 ms
コンパイル使用メモリ 58,456 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 16:20:14
合計ジャッジ時間 1,404 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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