結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2017-07-16 13:50:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 477 ms |
コンパイル使用メモリ | 62,208 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-08 04:13:47 |
合計ジャッジ時間 | 1,453 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <cmath> using namespace std; int main() { int x, y, l; cin >> x >> y >> l; int dir = 0; dir += ceil((double)abs(x)/l); dir += ceil((double)abs(y)/l); if(x && y) dir++; else if(x) dir++; else if(y < 0) dir++; if(y < 0) dir++; cout << dir << endl; return 0; }