結果

問題 No.48 ロボットの操縦
コンテスト
ユーザー vjudge1
提出日時 2026-11-23 16:43:13
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 751 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,289 ms
コンパイル使用メモリ 213,772 KB
実行使用メモリ 9,920 KB
最終ジャッジ日時 2026-11-23 16:43:17
合計ジャッジ時間 3,238 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

  int main() {
      ios::sync_with_stdio(false);
      cin.tie(nullptr);
      int t=1;
      while (t--) {
          int x,y,l;
          cin >> x >> y >> l;
          int x1 = abs(x);
          int y1 = abs(y);
          int c1 = x1+y1;
          int c2 = 0;
          if(c1%l==0){
            c2 = c1/l;
          } else {
            c2 = c1/l + 1;
          }

          int ec = 0;
          if(x>0 && y>0){
            ec = 1;
          } else if (x>0 && y<0){
            ec = 2;
          } else if(x<0 && y>0){
            ec = 1;
          } else if(x<0 && y<0){
            ec = 2;
          }
          int fc = ec + c2;
          cout << fc << endl;
      }
  }
0