QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#647706#5461. Paddle StarRepeater#WA 0ms4268kbC++20942b2024-10-17 15:19:302024-10-17 15:19:31

Judging History

你现在查看的是最新测评结果

  • [2024-10-17 15:19:31]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4268kb
  • [2024-10-17 15:19:30]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

#define int long long

using db = long double;

const db pi = acosl(-1.0L);

void solve(){
	int l, r, a, b;
	cin >> l >> r >> a >> b;

	db x = pi * a / 180;
	db y = pi * b / 180;
	db ans = x * ((l + r) * (l + r)) + y * r * r;

	if(b > 90){
		if(sinl(y - pi / 2) * l <= r){
			ans += sinl(y - pi / 2) * l * cosl(y - pi / 2) * l;
			ans -= (y - pi / 2) * cosl(y - pi / 2) * l * cosl(y - pi / 2) * l;
		}else{
			ans += sinl(y) * l * r;
			db d = sinl(y) * r * sinl(y) * r + (l - r * cosl(pi - y)) * (l - r * cosl(pi - y));
			ans -= atanl((sinl(y) * r) / (l - r * cosl(pi - y))) * d;
		}
	}

	cout << ans << "\n";
	return;
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	cout << fixed << setprecision(20);

	int t; cin >> t;
	while(t--) solve();

	return 0;
}

/*
5
2 1 20 20
3 3 0 0
20 20 90 120
20 10 50 170
100 10 1 93
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 4268kb

input:

5
2 1 20 20
3 3 0 0
20 20 90 120
20 10 50 170
100 10 1 93

output:

3.49065850398865915385
0.00000000000000000000
3367.15761190651085499326
1098.86327898408187730972
373.97816510564073877454

result:

wrong answer 5th numbers differ - expected: '373.9604896', found: '373.9781651', error = '0.0000473'