結果

問題 No.48 ロボットの操縦
ユーザー prog470
提出日時 2016-09-08 16:44:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 512 bytes
コンパイル時間 639 ms
コンパイル使用メモリ 68,560 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-15 22:18:30
合計ジャッジ時間 1,520 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <string>

using namespace std;

int main() {

	int X, Y, L;
	cin >> X >> Y >> L;

	int  cnt = 0;

	if (Y < 0) cnt++;
	if (X != 0) cnt++;
	
	/*
	cout << "dy: " << (abs(Y) + L - 1) << endl;
	cout << "dx: " << (abs(X) + L - 1) << endl;
	*/
	
	cnt += (abs(Y) + L-1 ) / L + (abs(X) + L - 1) / L;

	cout << cnt << endl;

	return 0;
}
0