結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2020-03-22 15:37:01 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 332 bytes |
コンパイル時間 | 1,961 ms |
コンパイル使用メモリ | 165,508 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 18:01:10 |
合計ジャッジ時間 | 3,047 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(0);int64_t X, Y, L;cin >> X >> Y >> L;int res = 0;if (Y < 0) res++;if (X != 0) res++;if (Y < 0 && X == 0) res++;res += (abs(X) + L - 1) / L;res += (abs(Y) + L - 1) / L;cout << res << '\n';return 0;}