結果

問題 No.48 ロボットの操縦
ユーザー NotationNap
提出日時 2015-05-06 21:26:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 371 bytes
コンパイル時間 1,130 ms
コンパイル使用メモリ 159,676 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 18:18:23
合計ジャッジ時間 1,870 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

typedef long long Int;
#define REP(i,n) for(int (i)=0;(i)<(int)(n);++(i))

int main() {
	int X, Y, L; cin >> X >> Y >> L;
	int ans = 0;
	{ if (X < 0) X = -X;  if (X > 0) ans++; }
	if (Y < 0) { if (Y != 0) ans++; if (X == 0 && Y < 0) ans++;  Y = -Y; }
	ans += (X + L - 1) / L;
	ans += (Y + L - 1) / L;
	cout << ans << endl;
}
0