QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#647706 | #5461. Paddle Star | Repeater# | WA | 0ms | 4268kb | C++20 | 942b | 2024-10-17 15:19:30 | 2024-10-17 15:19:31 |
Judging History
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
*/
详细
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'