結果

問題 No.48 ロボットの操縦
ユーザー jajagacchi
提出日時 2017-01-18 21:19:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 427 bytes
コンパイル時間 501 ms
コンパイル使用メモリ 58,880 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-23 01:19:18
合計ジャッジ時間 1,312 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <math.h>
#include <stdlib.h>

int main()
{
	long long X; std::cin >> X;
	long long Y; std::cin >> Y;
	long long L; std::cin >> L;
	long long ans = 0;
	ans += X/L + (X%L==0 ? 0 : 1);//ceil((double)abs(X)/L);
	ans += Y/L + (Y%L==0 ? 0 : 1);//ceil((double)abs(Y)/L);
	if(X == 0)
	{
		if(Y < 0) ans += 2;
	}
	else
	{
		if(Y > 0) ans++;
		else ans += 2;
	}
	std::cout << ans << std::endl;
	
	return 0;
}
0