結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2015-09-06 22:24:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 5,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 476 ms |
コンパイル使用メモリ | 54,104 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 18:24:18 |
合計ジャッジ時間 | 1,196 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include<iostream> int main() { int x, y, l, count = 0; std::cin >> x >> y >> l; if(y != 0){ count += abs(y) / l + 1; if (y%l == 0)count--; if (y < 0)count += 2; } if (x != 0) { count++;//左か右への回転 count += abs(x) / l + 1; if (x%l == 0)count--; if (y < 0)count--; } std::cout << count << std::endl; return 0; }