結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2019-08-31 16:11:02 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 508 bytes |
コンパイル時間 | 516 ms |
コンパイル使用メモリ | 63,600 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-24 21:57:50 |
合計ジャッジ時間 | 2,474 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 18 |
ソースコード
#include <iostream> #include <cstdlib> using namespace std; int main() { int x, y, l, ans=0; cin>>x>>y>>l; if(x>0&&y>0)ans++; if(x<0&&y<0)ans+=3; if(y==0||x<0)ans+=2; x=abs(x);y=abs(y); while(y>l){ if(y-l>0){ y-=l; } if(y<=l){ ans++; } ans++; } while(x>l){ if(x-l>0){ x-=l; } if(x<=l){ ans++; } ans++; } cout<<ans<<endl; return 0; }