結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2016-08-07 23:34:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 388 bytes |
コンパイル時間 | 494 ms |
コンパイル使用メモリ | 54,112 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 09:58:11 |
合計ジャッジ時間 | 2,694 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 1 |
ソースコード
#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++; } } else { count++; y *= (-1); while (y > 0) { y -= l; count++; } } if (x != 0) { count++; x = (x >= 0) ? x : (-x); while (x > 0) { x -= l; count++; } } cout << count << endl; return 0; }