QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#180984 | #5677. Clarissa's Conical Cannolis | Yshanqian | WA | 1ms | 4004kb | C++14 | 1.1kb | 2023-09-16 14:52:36 | 2023-09-16 14:52:37 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1)
#define xx first
#define yy second
#define endl "\n"
#define lowbit(x) x & (-x)
#define int long long
#define ull unsigned long long
#define pb push_back
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define Ysanqian ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
const int N = 1e6 + 10, M = 1010, inf = 0x3f3f3f3f, mod = 18446, P = 13331;
const double eps = 1e-8;
double d, s, r, o;
void solve()
{
cin >> d >> s >> r >> o;
double angle = pi * d / s; // 扇形角r/l*360
angle /= 2;
o /= 2;
if ((s - r) * sin(angle) - r < o) // 放在最下面都多了
cout << -1 << endl;
else if (r - (r * sin(angle)) < o) // 放在最上面都不够
cout << -2 << endl;
else
{
double h = (r - o) / sin(angle);
printf("%.1lf", s - h - r);
}
}
signed main()
{
Ysanqian;
int T;
T = 1;
// cin >> T;
while (T--)
solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 4004kb
input:
8.00 12.00 5.00 0.50
output:
1.5
result:
ok single line: '1.5'
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3872kb
input:
5.00 12.00 5.00 0.50
output:
-1
result:
wrong answer 1st lines differ - expected: '-1.0', found: '-1'