QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#208317 | #5152. Circular Caramel Cookie | Aeren# | WA | 2ms | 3980kb | C++20 | 625b | 2023-10-09 13:34:38 | 2023-10-09 13:34:39 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
cin.tie(0)->sync_with_stdio(false);
cin.exceptions(ios::badbit | ios::failbit);
cout << fixed << setprecision(15);
int th;
cin >> th;
auto cnt = [&](double r){
long long res = 0;
for(auto x = 1; x <= r; ++ x){
res += sqrt(max(0.0, r * r - 1.0 * x * x));
}
return 4 * res;
};
double low = 0, high = 300000;
for(auto rep = 300; rep > 0; -- rep){
double mid = (low + high) / 2;
if(cnt(mid) < th){
low = mid;
}
else{
high = mid;
}
}
cout << (low + high) / 2 << "\n";
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3876kb
input:
11
output:
2.236067977499790
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3924kb
input:
59
output:
5.000000000000000
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3876kb
input:
1
output:
1.414213562373095
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3936kb
input:
2
output:
1.414213562373095
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3980kb
input:
3
output:
1.414213562373095
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #6:
score: -100
Wrong Answer
time: 2ms
memory: 3936kb
input:
4
output:
1.414213562373095
result:
wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142136', error = '0.3675445'