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