QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#162370#5677. Clarissa's Conical CannolisJenniferLingWA 1ms4072kbC++20684b2023-09-03 11:19:492023-09-03 11:19:50

Judging History

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

  • [2023-09-03 11:19:50]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4072kb
  • [2023-09-03 11:19:49]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define SZ(a) (int) a.size()
#define endl '\n'
#define X first
#define Y second

void solve(){
  double d, s, r, o;
  cin >> d >> s >> r >> o;
  const double pi = 3.14159265;
  double ang = sin(pi*d/2/s);
  if((s-r)*ang< r - o/2){
    cout << "-1.0\n";
    return;
  } 
  if(r*ang > r - o/2){
    cout << "-2.0\n";
    return;
  }
  cout << setprecision(2) << (ang*(s-r)+o/2.0-r)/ang << "\n";
}

int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int 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: 4056kb

input:

8.00 12.00 5.00 0.50

output:

1.5

result:

ok single line: '1.5'

Test #2:

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

input:

5.00 12.00 5.00 0.50

output:

-1.0

result:

ok single line: '-1.0'

Test #3:

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

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: 3904kb

input:

7.00 12.00 3.00 0.90

output:

5.8

result:

ok single line: '5.8'

Test #5:

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

input:

8.50 12.00 3.00 0.90

output:

-2.0

result:

ok single line: '-2.0'

Test #6:

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

input:

10.00 12.00 3.00 0.70

output:

-2.0

result:

ok single line: '-2.0'

Test #7:

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

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: 4024kb

input:

7.00 12.00 3.50 0.70

output:

4.5

result:

ok single line: '4.5'

Test #9:

score: -100
Wrong Answer
time: 1ms
memory: 4072kb

input:

8.50 12.00 3.50 0.70

output:

5

result:

wrong answer 1st lines differ - expected: '5.0', found: '5'