QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#180984#5677. Clarissa's Conical CannolisYshanqianWA 1ms4004kbC++141.1kb2023-09-16 14:52:362023-09-16 14:52:37

Judging History

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

  • [2023-09-16 14:52:37]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4004kb
  • [2023-09-16 14:52:36]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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'