QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#66117 | #5152. Circular Caramel Cookie | feeder1# | WA | 3ms | 3636kb | C++14 | 534b | 2022-12-06 22:51:12 | 2022-12-06 22:51:13 |
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.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'