結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ikd
                         | 
                    
| 提出日時 | 2015-10-31 09:38:03 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 486 bytes | 
| コンパイル時間 | 531 ms | 
| コンパイル使用メモリ | 58,096 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-09-13 06:15:51 | 
| 合計ジャッジ時間 | 2,113 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 25 | 
ソースコード
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main(){
    int x, y, l;
    cin>> x>> y>> l;
    int cnt = 0;
    if(y < 0){
        cnt++; //to south
        y = -y;
    }
    while(1){
        y -= l;
        cnt++;
        if(y<=0) break;
    }
    cout<< cnt<< endl;
    if(x!=0) cnt++; //to west OR to east
    if(x < 0) x = -x;
    while(1){
        x -= l;
        cnt++;
        if(x<=0) break;
    }
    cout<< cnt<< endl;
    return 0;
}
            
            
            
        
            
ikd