QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#66118#5152. Circular Caramel Cookiefeeder1#WA 2ms3696kbC++14538b2022-12-06 22:53:102022-12-06 22:53:14

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:53:14]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3696kb
  • [2022-12-06 22:53:10]
  • 提交

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.00000001 <= 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.00000001;
  } else {
   lo = mid + 0.00000001;
  }
 }
 cout << fixed << setprecision(10) << ans;
}

详细

Test #1:

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

input:

11

output:

2.2360679939

result:

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

Test #2:

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

input:

59

output:

5.0000000042

result:

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

Test #3:

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

input:

1

output:

1.4142135697

result:

ok found '1.4142136', expected '1.4142136', error '0.0000000'

Test #4:

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

input:

2

output:

1.4142135697

result:

ok found '1.4142136', expected '1.4142136', error '0.0000000'

Test #5:

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

input:

3

output:

1.4142135697

result:

ok found '1.4142136', expected '1.4142136', error '0.0000000'

Test #6:

score: -100
Wrong Answer
time: 2ms
memory: 3516kb

input:

4

output:

1.4142135697

result:

wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142136', error = '0.3675445'