結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             prog470
                         | 
                    
| 提出日時 | 2016-09-08 17:00:01 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 636 bytes | 
| コンパイル時間 | 761 ms | 
| コンパイル使用メモリ | 68,672 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-15 22:18:57 | 
| 合計ジャッジ時間 | 1,668 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 24 WA * 1 | 
ソースコード
#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 && X != 0) {
		cnt++;
	}
	else if(Y<0 && X != 0) {
		cnt += 2;
	}
	else if(Y > 0 && X == 0){
		cnt++;
	}
	else if(Y < 0 && X == 0){
		cnt += 2;
	}
	
	/*
	cout << "dy: " << (abs(Y) + L - 1)/L << endl;
	cout << "dx: " << (abs(X) + L - 1)/L << endl;
	*/
	
	cnt += (abs(Y) + L-1 ) / L + (abs(X) + L - 1) / L;
	cout << cnt << endl;
	return 0;
}
            
            
            
        
            
prog470