QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#501189#5152. Circular Caramel CookieAu_GoldWA 0ms3868kbC++20466b2024-08-02 15:30:132024-08-02 15:30:13

Judging History

你现在查看的是最新测评结果

  • [2024-08-02 15:30:13]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3868kb
  • [2024-08-02 15:30:13]
  • 提交

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