結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2015-09-30 08:36:16 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 400 bytes |
コンパイル時間 | 1,356 ms |
コンパイル使用メモリ | 157,280 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-21 18:26:38 |
合計ジャッジ時間 | 2,219 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include "bits/stdc++.h" using namespace std; #define REP(i, n) for(int i=0; i<(n); i++) int X,Y,L; signed main() { cin>>X>>Y>>L; int cnt = 0; if (Y > 0) { cnt += (Y+L-1)/L; } else if (Y < 0) { Y *= -1; cnt += (Y+L-1)/L + 1; if (X == 0) cnt++; } if (X != 0) { cnt += (abs(X)+L-1)/L + 1; } cout << cnt << endl; return 0; }