結果

問題 No.48 ロボットの操縦
ユーザー ike_1225
提出日時 2018-03-23 14:32:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 438 bytes
コンパイル時間 608 ms
コンパイル使用メモリ 69,980 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 21:27:49
合計ジャッジ時間 1,314 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main() {
	double X, Y, L, ans = 0, A = 0, B = 0;
	std::cin >> X >> Y >> L;

	if (Y != B) {
		if (Y > 0)
			ans += ceil(Y / L);
		else {
			ans++;
			ans += ceil(abs(Y / L));
		}
	}

	if (X != A) {
		if (X > 0) {
			ans++;
			ans += ceil(X / L);
		}
		else {
			ans++;
			ans += ceil(abs(X / L));
		}
	}

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