結果

問題 No.48 ロボットの操縦
ユーザー ei1333333
提出日時 2016-09-08 00:22:48
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 293 bytes
コンパイル時間 1,240 ms
コンパイル使用メモリ 157,392 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-15 21:21:09
合計ジャッジ時間 2,022 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main()
{
  int X, Y, L;
  cin >> X >> Y >> L;
  if(X == 0 && Y == 0) {
    cout << 0 << endl;
  } else {
    int cost = (abs(X) + L - 1) / L + (abs(Y) + L - 1) / L;
    if(Y < 0) ++cost;
    if(X != 0) ++cost;
    cout << cost << endl;
  }
}
0