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