結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
![]() |
提出日時 | 2017-07-08 16:26:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 535 bytes |
コンパイル時間 | 571 ms |
コンパイル使用メモリ | 67,072 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 19:45:29 |
合計ジャッジ時間 | 1,268 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 23 |
ソースコード
#include <iostream> #include <cmath> using namespace std; #define rep(i,n) for(int i = 0; i < (n); i++) int main(){ int x = 0; cin >> x; int y = 0; cin >> y; int l = 0; cin >> l; int mo = 0; int res = 0; if(y<0){ mo = y/l; res=y%l; if(res!=0){ mo+=1; }} else if(y>0){ y = abs(y); mo+=1; mo+=y/l; res=y%l; if(res!=0){ mo+=1; }} if(x<0){ mo+=1; mo+=x/l; res=y%l; if(res!=0){ mo+=1; }} else if(x>0){ x = abs(x); mo+=1; mo+=x/l; res=y%l; if(res!=0){ mo+=1; }} cout << mo << endl; return 0; }