結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2017-06-07 12:42:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 688 ms |
コンパイル使用メモリ | 65,064 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-22 12:43:06 |
合計ジャッジ時間 | 1,321 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <iostream> using namespace std; int main () { int x,y,l; cin >> x >> y >> l; int cnt = abs(y)/l; if (abs(y)%l) { cnt++; } cnt += abs(x)/l; if (abs(x)%l) { cnt++; } if((y>0 && x!=0) || (y==0 && x!=0)) { cnt+=1; } else if(y<0) { cnt+=2; } cout << cnt << endl; return 0; }