結果

問題 No.48 ロボットの操縦
ユーザー kpinkcatkpinkcat
提出日時 2023-08-04 14:27:21
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 475 bytes
コンパイル時間 775 ms
コンパイル使用メモリ 103,064 KB
最終ジャッジ日時 2025-02-15 21:55:44
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<algorithm>
#include<cctype>
#include<set>
#include<bitset>
#include<math.h>
#include<map>
#include<queue>
#include<iomanip>
using namespace std;

int main(){
    long long x, y, l, ans = 0;
    cin >> x >> y >> l;
    if (y < 0) ans += 2;
    else if (abs(x)) ans++;
    if (!(y%l)) ans += abs(y)/l;
    else ans += (abs(y)/l + 1);
    if (!(abs(x)%l)) ans += abs(x)/l;
    else ans += (abs(x)/l + 1);

    cout << ans << endl;
}
0