結果

問題 No.48 ロボットの操縦
ユーザー lice6613
提出日時 2019-04-30 12:35:18
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 303 bytes
コンパイル時間 1,783 ms
コンパイル使用メモリ 166,332 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-29 17:54:09
合計ジャッジ時間 3,072 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

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