QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#186750 | #5152. Circular Caramel Cookie | Forever_Young# | WA | 2ms | 3952kb | C++14 | 516b | 2023-09-24 11:11:33 | 2023-09-24 11:11:34 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
typedef double D;
typedef long long LL;
int main() {
int s;
scanf("%d", &s);
D le = 0, ri = 1e6;
for(int i = 0; i < 80; i++) {
D mid = (le + ri) / 2;
LL cnt = 0;
D sq = mid * mid;
for(LL j = 0; j + 1 < mid; j++) {
D rmn = sq - (j + 1) * (j + 1);
cnt += (LL)sqrt(rmn);
}
if(cnt * 4 >= s) {
ri = mid;
}else {
le = mid;
}
}
printf("%.12f\n", (double)le);
}
详细
Test #1:
score: 100
Accepted
time: 2ms
memory: 3884kb
input:
11
output:
2.236067977500
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3940kb
input:
59
output:
5.000000000000
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3952kb
input:
1
output:
1.414213562373
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3900kb
input:
2
output:
1.414213562373
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3904kb
input:
3
output:
1.414213562373
result:
ok found '1.4142136', expected '1.4142136', error '0.0000000'
Test #6:
score: -100
Wrong Answer
time: 0ms
memory: 3932kb
input:
4
output:
1.414213562373
result:
wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142136', error = '0.3675445'