QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3868kb
input:
11
output:
nan
result:
wrong output format Expected double, but "nan" found