QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#181067#5677. Clarissa's Conical CannolisYshanqianWA 0ms4140kbC++14827b2023-09-16 15:32:552023-09-16 15:32:55

Judging History

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

  • [2023-09-16 15:32:55]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4140kb
  • [2023-09-16 15:32:55]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define ios ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define int long long
#define ULL unsigned long long
#define endl "\n"
#define pi acos(-1)
typedef pair<int, int> PII;
typedef pair<int, PII> PIII;
const int N = 1e6 + 10, M = 1010, INF = 0x3f3f3f3f, mod = 998244353;
void solve()
{
    double d, s, r, o;
    cin >> d >> s >> r >> o;
    double A = d * pi / s; // 扇形的角
    if (r-(s - r) * sin(A / 2)  < o / 2)
        cout << "-1.0" << endl;
    else if (r - (r * sin(A / 2)) < o / 2)
        cout << "-2.0" << endl;
    else
    {
        double x = (r - o / 2) / sin(A / 2);
        printf("%.1lf\n", s - x - r);
    }
}
signed main()
{
    ios;
    int T = 1;
    // cin >> T;
    while (T--)
        solve();
    return 0;
}

詳細信息

Test #1:

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

input:

8.00 12.00 5.00 0.50

output:

-1.0

result:

wrong answer 1st lines differ - expected: '1.5', found: '-1.0'