結果

問題 No.98 円を描こう
ユーザー PachicobuePachicobue
提出日時 2020-02-04 20:54:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 472 bytes
コンパイル時間 839 ms
コンパイル使用メモリ 84,768 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 06:34:00
合計ジャッジ時間 2,459 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <cmath>
int main()
{
    int x, y;std::cin >> x >> y;
    x = std::abs(x), y=std::abs(y);
    const int R = x*x+y*y;
    int min = 1<<30;
    for(int i =0; i <= 2*x+1; i++){
        for(int j =0; j <=2*y+1; j++){
            const int r = i*i+j*j;
            if(r>R){min = std::min(min, r);}
        }
    }
    std::cout << std::fixed << std::setprecision(15)<< std::sqrt((long double)(min)*2)<< std::endl;
    return 0;
}
0