QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#501511 | #5152. Circular Caramel Cookie | ziripo | WA | 23ms | 3976kb | C++20 | 404b | 2024-08-02 19:52:01 | 2024-08-02 19:52:01 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
bool check(double mid, double s) {
int sum = 0;
for (int i = 1; i < mid; i++)
sum += sqrtf(mid * mid - i * i);
sum *= 4;
return sum <= s;
}
int main() {
double s; cin >> s;
double l = 1, r = 1e5;
while (l < r - (double)1e-8) {
double mid = (l + r) / 2;
if (check(mid, s))l = mid;
else r = mid;
}
printf("%.10f", l);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3916kb
input:
11
output:
2.2360679504
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3816kb
input:
59
output:
4.9999996662
result:
ok found '4.9999997', expected '5.0000000', error '0.0000001'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3972kb
input:
1
output:
1.4142135498
result:
ok found '1.4142135', expected '1.4142136', error '0.0000000'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
2
output:
1.4142135498
result:
ok found '1.4142135', expected '1.4142136', error '0.0000000'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3800kb
input:
3
output:
1.4142135498
result:
ok found '1.4142135', expected '1.4142136', error '0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
4
output:
2.2360679390
result:
ok found '2.2360679', expected '2.2360680', error '0.0000000'
Test #7:
score: -100
Wrong Answer
time: 23ms
memory: 3976kb
input:
1000000000
output:
99999.9999999943
result:
wrong answer 1st numbers differ - expected: '17841.8813190', found: '100000.0000000', error = '4.6047901'