結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             kei
                         | 
                    
| 提出日時 | 2016-08-07 23:29:22 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 391 bytes | 
| コンパイル時間 | 653 ms | 
| コンパイル使用メモリ | 53,980 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-07 09:55:14 | 
| 合計ジャッジ時間 | 2,453 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 WA * 6 | 
ソースコード
#include <iostream>
using namespace std;
int main() {
	int x, y, l;
	int count = 0;
	cin >> x >> y >> l;
	if (y >= 0) {
		while (y > 0) {
			y -= l;
			count++;
		}
	}
	else {
		count += 2;
		y *= (-1);
		while (y > 0) {
			y -= l;
			count++;
		}
	}
	if (x != 0) {
		count++;
		x = (x >= 0) ? x : (-x);
		while (x > 0) {
			x -= l;
			count++;
		}
	}
	cout << count << endl;
	return 0;
}
            
            
            
        
            
kei