結果

問題 No.48 ロボットの操縦
ユーザー ikd
提出日時 2015-10-31 10:04:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 361 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 60,692 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-21 18:30:05
合計ジャッジ時間 1,259 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#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+=2;
    }else if(x!=0){
        cnt++;
    }
    
    if(x<0) x = -x;
    cnt += ceil((double)x/l);
    if(y<0) y = -y;
    cnt += ceil((double)y/l);

    cout<< cnt<< endl;

    return 0;
}
0