QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#66117#5152. Circular Caramel Cookiefeeder1#WA 3ms3636kbC++14534b2022-12-06 22:51:122022-12-06 22:51:13

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-06 22:51:13]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3636kb
  • [2022-12-06 22:51:12]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long double ll;

int main() {
 int n, m, i, j, k, b, c;
 cin >> n;
 ll lo = 1, hi = 20000, mid, ans;
 while ( lo + 0.0000001 <= hi ) {
  mid = ( lo + hi ) / 2;
  int a = mid, sum = 0;
  for ( int i = 1; i <= a; i++ ) {
   ll x = (ll)i;
   ll y = sqrt(mid * mid - x * x);
   b = y;
   sum += b;
  }
  sum *= 4;
  if ( sum >= n ) {
   ans = mid;
   hi = mid - 0.0000001;
  } else {
   lo = mid + 0.0000001;
  }
 }
 cout << fixed << setprecision(7) << ans;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3520kb

input:

11

output:

2.2360680

result:

ok found '2.2360680', expected '2.2360680', error '0.0000000'

Test #2:

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

input:

59

output:

5.0000000

result:

ok found '5.0000000', expected '5.0000000', error '0.0000000'

Test #3:

score: 0
Accepted
time: 2ms
memory: 3636kb

input:

1

output:

1.4142137

result:

ok found '1.4142137', expected '1.4142136', error '0.0000001'

Test #4:

score: 0
Accepted
time: 2ms
memory: 3528kb

input:

2

output:

1.4142137

result:

ok found '1.4142137', expected '1.4142136', error '0.0000001'

Test #5:

score: 0
Accepted
time: 2ms
memory: 3492kb

input:

3

output:

1.4142137

result:

ok found '1.4142137', expected '1.4142136', error '0.0000001'

Test #6:

score: -100
Wrong Answer
time: 3ms
memory: 3520kb

input:

4

output:

1.4142137

result:

wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142137', error = '0.3675444'