結果

問題 No.948 Bomb vs Dush
ユーザー ningenMeningenMe
提出日時 2019-11-22 14:29:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 601 bytes
コンパイル時間 1,348 ms
コンパイル使用メモリ 162,980 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 10:15:17
合計ジャッジ時間 11,748 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 211 ms
6,944 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 229 ms
6,940 KB
testcase_05 AC 206 ms
6,940 KB
testcase_06 AC 228 ms
6,940 KB
testcase_07 AC 228 ms
6,940 KB
testcase_08 AC 230 ms
6,944 KB
testcase_09 AC 208 ms
6,940 KB
testcase_10 AC 228 ms
6,944 KB
testcase_11 WA -
testcase_12 AC 229 ms
6,940 KB
testcase_13 AC 234 ms
6,940 KB
testcase_14 AC 228 ms
6,940 KB
testcase_15 AC 228 ms
6,940 KB
testcase_16 AC 213 ms
6,944 KB
testcase_17 AC 231 ms
6,940 KB
testcase_18 AC 232 ms
6,944 KB
testcase_19 AC 234 ms
6,940 KB
testcase_20 WA -
testcase_21 AC 243 ms
6,940 KB
testcase_22 AC 209 ms
6,940 KB
testcase_23 AC 236 ms
6,940 KB
testcase_24 AC 225 ms
6,944 KB
testcase_25 AC 211 ms
6,944 KB
testcase_26 AC 235 ms
6,940 KB
testcase_27 AC 233 ms
6,944 KB
testcase_28 AC 235 ms
6,940 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 238 ms
6,940 KB
testcase_32 WA -
testcase_33 AC 235 ms
6,940 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 240 ms
6,944 KB
testcase_39 AC 229 ms
6,940 KB
testcase_40 AC 209 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
constexpr long double PI = 3.1415926535897932384626433;
//Euclidean distance
template<class T> T EucDist(T x1, T y1, T x2, T y2) {
    return sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
}

int main() {
	double r,R,ok = 180., ng = 360., md,x,y,d;
    cin >> r >> R;
	for(int i = 0; i < 1000000; ++i){
		md = (ok+ng)/2.;
		x = R*cos(md/180.*PI);
		y = R*sin(md/180.*PI);
		d = EucDist(x,y,R,0.);
		(2*r<=d?ok:ng)=md;
	}
	double area = PI*((R+r)*(R+r)-(R-r)*(R-r))*ok/360. + PI*r*r;
	double t = PI*ok/180.;
	printf("%.4f\n",t);
	printf("%.4f\n",area);
}
0