結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー ikd
提出日時 2015-10-31 09:38:03
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 486 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 303 ms
コンパイル使用メモリ 76,644 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-08-25 23:48:59
合計ジャッジ時間 2,751 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
}
0