結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             msm1993
                         | 
                    
| 提出日時 | 2020-03-31 17:53:33 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 550 bytes | 
| コンパイル時間 | 1,788 ms | 
| コンパイル使用メモリ | 167,176 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-06-24 21:46:21 | 
| 合計ジャッジ時間 | 2,297 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 25 | 
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define repi(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define SIZE_OF_ARRAY(array)    (sizeof(array)/sizeof(array[0]))
typedef long long ll;
using namespace std;
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  double x,y,z;
  cin >> x >> y >> z;
  if(y>=0 && x==0){
    cout << (int)ceil(y/z) << endl;
  }else if(y>=0 && x!=0){
    cout << (int)ceil(y/z)+1+ceil(abs(x)/z)<<endl;
  }else{
    cout << (int)(ceil(abs(y/z))+2+ceil(abs(x)/z)) << endl;
  }
  return 0;
}
            
            
            
        
            
msm1993