結果

問題 No.48 ロボットの操縦
ユーザー siguma323
提出日時 2016-05-05 11:33:20
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 639 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 86,108 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-05 09:29:51
合計ジャッジ時間 1,467 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <numeric>
#include <string>
#include <vector>
#include <iostream>
#include <queue>
#include <utility>
#include <cmath>
#include <map>
#include <unordered_map>
#include <functional>
#include <fstream>
using namespace std;

using ull = unsigned long long;

int main()
{
    int x,y,l;
    cin >> x >> y >> l;

    int num = abs(x/l) + abs(y/l);
    if(x !=0)
    {
        ++num;
        if(x % l != 0)
            ++num;
    }
    if(y > 0)
    {
        if(y % l != 0)
            ++num;
    }

    if(y < 0)
    {
        ++num;
        if(y % l !=0)
            ++num;
    }
    
    cout << num << endl;
}
0