結果

問題 No.48 ロボットの操縦
ユーザー wikeaka
提出日時 2016-09-01 20:55:34
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 310 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 59,540 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 18:49:33
合計ジャッジ時間 1,233 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>

using namespace std;
int main() {
  int X, Y, L;
  cin >> X >> Y >> L;

  int c = 0;

  if (Y < 0)
    c += 2;
  else
    c += X == 0 ? 0 : 1;

  c += ceil(abs(X) / static_cast<double>(L));
  c += ceil(abs(Y) / static_cast<double>(L));

  cout << c << endl;
  return 0;
}
0