結果
| 問題 | 
                            No.48 ロボットの操縦
                             | 
                    
| コンテスト | |
| ユーザー | 
                             focus
                         | 
                    
| 提出日時 | 2018-01-30 16:53:00 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 364 bytes | 
| コンパイル時間 | 498 ms | 
| コンパイル使用メモリ | 62,720 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-29 21:39:29 | 
| 合計ジャッジ時間 | 1,317 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 23 WA * 2 | 
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
    long long X,Y,L,ans=0;
    cin >> X >> Y >> L;
    if(Y<0){ 
        Y*=-1;
        if(X==0)    ans+=2;
        else    ans++;
    }
    if(X<0) X*=-1;
    if(X>0) ans++;
    ans += ((X-1)/L)+((Y-1)/L)+2;
    cout << ans;
    return 0;
}
            
            
            
        
            
focus