QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#501189 | #5152. Circular Caramel Cookie | Au_Gold | WA | 0ms | 3868kb | C++20 | 466b | 2024-08-02 15:30:13 | 2024-08-02 15:30:13 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
const int N = 1e5 + 5, M = 1e4 + 5, mod = 7;
const double gen2 = sqrt(2);
int main() {
ll need;
cin >> need;
need++;
ll n = 0;
while (4*n*n<need) {
n++;
}
if((n*n-1)*4>=need) {
printf("%llf\n", sqrt((n - 1) * (n - 1) + n * n));
}else {
printf("%llf\n", n * gen2);
}
}
详细
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3868kb
input:
11
output:
nan
result:
wrong output format Expected double, but "nan" found