結果

問題 No.172 UFOを捕まえろ
ユーザー tottoripapertottoripaper
提出日時 2015-03-27 00:42:35
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 574 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 33,148 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-11 10:34:53
合計ジャッジ時間 1,572 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// Wrongri-La Shower

// 45度回転

#include<cstdio>
#include<cmath>

typedef long long ll;

const double EPS = 1e-9;

int X, Y;
double R;

bool can(int k){
    return X-R > -k && k > X+R && Y-R > -k && k > Y+R;
}

int main(){
    scanf("%d %d %lf", &X, &Y, &R);
    {
        int x = X + Y, y = X - Y;
        X = x; Y = y;

        R *= std::sqrt(2);
    }

    int lb = X + Y, ub = 252521;
    while(ub - lb > 1){
        int mid = (lb+ub) / 2;
        if(can(mid)){
            ub = mid;
        }else{
            lb = mid;
        }
    }

    printf("%d\n", ub);
}
0