QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#66118 | #5152. Circular Caramel Cookie | feeder1# | WA | 2ms | 3696kb | C++14 | 538b | 2022-12-06 22:53:10 | 2022-12-06 22:53:14 |
Judging History
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'