結果
問題 | No.48 ロボットの操縦 |
ユーザー |
![]() |
提出日時 | 2022-03-27 21:38:14 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 718 bytes |
コンパイル時間 | 691 ms |
コンパイル使用メモリ | 66,128 KB |
最終ジャッジ日時 | 2025-01-28 13:08:42 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 17 |
ソースコード
#include <iostream> using namespace std; int main() { int X, Y, L; cin >> X >> Y >> L; int stepx, stepy; int rot; stepx = abs(X) / L + ( X%L==0?0:1 ); stepy = abs(Y) / L + ( Y%L==0?0:1 ); if( X == 0 && Y == 0 ) { rot = 0; } else if( X == 0 && Y > 0 ) { rot = 0; } else if( X > 0 && Y > 0 ) { rot = 1; } else if( X > 0 && Y == 0 ) { rot = 1; } else if( X > 0 && Y < 0 ) { rot = 2; } else if( X == 0 && Y < 0 ) { rot = 2; } else if( X < 0 && Y < 0 ) { rot = 3; } else if( X < 0 && Y == 0 ) { rot = 3; } else if( X < 0 && Y > 0 ) { rot = 3; } //cout << stepx << endl; //cout << stepy << endl; //cout << rot << endl; cout << stepx+stepy+rot << endl; return 0; }