結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2016-02-15 00:11:28 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 374 ms |
コンパイル使用メモリ | 53,980 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 18:35:11 |
合計ジャッジ時間 | 1,336 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <iostream> using namespace std; int main() { int x, y, l; long long ans = 0; cin >> x >> y >> l; if (y != 0) ans += (abs(y)-1) / l + 1; if (x != 0) ans += (abs(x)-1) / l + 1; if (y < 0) ans += 2; else if (x != 0) ans++; cout << ans << endl; return 0; }