QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#181106#5677. Clarissa's Conical CannolisCloudsAC ✓1ms4300kbC++14492b2023-09-16 15:47:292023-09-16 15:47:29

Judging History

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

  • [2023-09-16 15:47:29]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:4300kb
  • [2023-09-16 15:47:29]
  • 提交

answer

#include<bits/stdc++.h>
#define endl '\n'
#define int long long
#define pi acos(-1.0)
using namespace std;
double d,s,r,o;


signed main()
{
    cin>>d>>s>>r>>o;
    double x1=2*(r-sin(pi*d/s/2)*r);
    double x2=2*(r-sin(pi*d/s/2)*(s-r));
    double x3=s-(r-o/2)/sin(pi*d/s/2)-r;
    if(x1<o)
    {
        cout<<"-2.0"<<endl;
        return 0;
    }
    if(x2>o)
    {
        cout<<"-1.0"<<endl;
        return 0;
    }
    printf("%.1lf\n",x3);
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 4300kb

input:

8.00 12.00 5.00 0.50

output:

1.5

result:

ok single line: '1.5'

Test #2:

score: 0
Accepted
time: 0ms
memory: 4036kb

input:

5.00 12.00 5.00 0.50

output:

-1.0

result:

ok single line: '-1.0'

Test #3:

score: 0
Accepted
time: 0ms
memory: 4048kb

input:

11.00 12.00 5.00 0.50

output:

-2.0

result:

ok single line: '-2.0'

Test #4:

score: 0
Accepted
time: 0ms
memory: 4120kb

input:

7.00 12.00 3.00 0.90

output:

5.8

result:

ok single line: '5.8'

Test #5:

score: 0
Accepted
time: 0ms
memory: 4048kb

input:

8.50 12.00 3.00 0.90

output:

-2.0

result:

ok single line: '-2.0'

Test #6:

score: 0
Accepted
time: 0ms
memory: 4164kb

input:

10.00 12.00 3.00 0.70

output:

-2.0

result:

ok single line: '-2.0'

Test #7:

score: 0
Accepted
time: 0ms
memory: 4196kb

input:

5.50 12.00 3.50 0.30

output:

3.4

result:

ok single line: '3.4'

Test #8:

score: 0
Accepted
time: 1ms
memory: 4244kb

input:

7.00 12.00 3.50 0.70

output:

4.5

result:

ok single line: '4.5'

Test #9:

score: 0
Accepted
time: 0ms
memory: 4232kb

input:

8.50 12.00 3.50 0.70

output:

5.0

result:

ok single line: '5.0'

Test #10:

score: 0
Accepted
time: 0ms
memory: 4044kb

input:

10.00 12.00 3.50 0.30

output:

-2.0

result:

ok single line: '-2.0'

Test #11:

score: 0
Accepted
time: 0ms
memory: 4200kb

input:

5.50 12.00 4.00 0.70

output:

2.5

result:

ok single line: '2.5'

Test #12:

score: 0
Accepted
time: 0ms
memory: 4052kb

input:

7.00 12.00 4.00 0.90

output:

3.5

result:

ok single line: '3.5'

Test #13:

score: 0
Accepted
time: 0ms
memory: 4116kb

input:

8.50 12.00 4.00 0.50

output:

3.8

result:

ok single line: '3.8'

Test #14:

score: 0
Accepted
time: 0ms
memory: 4124kb

input:

10.00 12.00 4.00 0.30

output:

-2.0

result:

ok single line: '-2.0'

Test #15:

score: 0
Accepted
time: 0ms
memory: 4232kb

input:

5.50 12.00 4.50 0.50

output:

1.1

result:

ok single line: '1.1'

Test #16:

score: 0
Accepted
time: 1ms
memory: 4268kb

input:

7.00 12.00 4.50 0.50

output:

2.1

result:

ok single line: '2.1'

Test #17:

score: 0
Accepted
time: 0ms
memory: 4200kb

input:

8.50 12.00 4.50 0.70

output:

2.9

result:

ok single line: '2.9'

Test #18:

score: 0
Accepted
time: 1ms
memory: 4040kb

input:

10.00 12.00 4.50 0.50

output:

-2.0

result:

ok single line: '-2.0'

Test #19:

score: 0
Accepted
time: 0ms
memory: 4048kb

input:

5.50 12.00 5.00 0.30

output:

-1.0

result:

ok single line: '-1.0'

Test #20:

score: 0
Accepted
time: 0ms
memory: 4188kb

input:

7.00 12.00 5.00 0.90

output:

1.3

result:

ok single line: '1.3'

Test #21:

score: 0
Accepted
time: 0ms
memory: 4132kb

input:

8.50 12.00 5.00 0.70

output:

1.8

result:

ok single line: '1.8'

Test #22:

score: 0
Accepted
time: 0ms
memory: 4284kb

input:

10.00 12.00 5.00 0.30

output:

2.0

result:

ok single line: '2.0'

Test #23:

score: 0
Accepted
time: 0ms
memory: 4108kb

input:

5.50 12.00 5.50 0.90

output:

-1.0

result:

ok single line: '-1.0'