結果

問題 No.48 ロボットの操縦
ユーザー Lavender
提出日時 2019-08-31 16:10:14
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 547 bytes
コンパイル時間 6,958 ms
コンパイル使用メモリ 64,312 KB
実行使用メモリ 13,636 KB
最終ジャッジ日時 2024-11-24 21:54:04
合計ジャッジ時間 8,716 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 22 OLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
            cout << "y=" << y << endl;
        }
        if(y<=l){
            ans++;
        }
        ans++;
    }
    while(x>l){
        if(x-l>0){
            x-=l;
        }
        if(x<=l){
            ans++;
        }
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}
0