結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2014-11-21 14:13:12 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 337 bytes |
コンパイル時間 | 535 ms |
コンパイル使用メモリ | 58,956 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 18:08:20 |
合計ジャッジ時間 | 1,278 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <iostream> #include <cstdlib> #include <cmath> using namespace std; int main(){ int x, y, l; while(cin >> x >> y >> l){ int ans = 0; if(x != 0) ans = 1; if(y < 0) ans = 2; if(x != 0) ans += (abs(x) - 1) / l + 1; if(y != 0) ans += (abs(y) - 1) / l + 1; cout << ans << endl; } }