QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#66485 | #5152. Circular Caramel Cookie | karuna# | WA | 3ms | 3616kb | C++17 | 512b | 2022-12-08 19:12:48 | 2022-12-08 19:12:52 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll func(ll R) {
ll ans = 0;
for (ll i = 1; i * i <= R; i++) {
ans += floor(sqrt(R - i * i));
}
return ans * 4;
}
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
ll n; cin >> n;
ll L = 0, R = 4'000'000'000ll;
while (L < R) {
ll M = (L + R) / 2;
if (func(M) >= n) R = M;
else L = M + 1;
}
cout.precision(20);
cout << fixed << sqrt(L);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3580kb
input:
11
output:
2.23606797749978980505
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 3ms
memory: 3468kb
input:
59
output:
5.00000000000000000000
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 3ms
memory: 3612kb
input:
1
output:
1.41421356237309514547
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #4:
score: 0
Accepted
time: 3ms
memory: 3612kb
input:
2
output:
1.41421356237309514547
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #5:
score: 0
Accepted
time: 3ms
memory: 3608kb
input:
3
output:
1.41421356237309514547
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #6:
score: -100
Wrong Answer
time: 1ms
memory: 3616kb
input:
4
output:
1.41421356237309514547
result:
wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142136', error = '0.3675445'