QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#677274#5152. Circular Caramel Cookiewifi32767WA 1ms3924kbC++20684b2024-10-26 10:53:482024-10-26 10:53:52

Judging History

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

  • [2024-10-26 10:53:52]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3924kb
  • [2024-10-26 10:53:48]
  • 提交

answer

#include<bits/stdc++.h>
using ll = long long;
#define endl '\n'
// #define int long long
using namespace std;
const int MAX = 2e5 + 5;

ll check(double x){
    ll res = 0;
    for (double i = 1; i <= x; i ++){
        res += floor(sqrt(x * x - i * i));
    }
    res *= 4ll;
    return res;
}
void solve(){
    ll s;
    cin >> s;
    double lk = 0.0, rk = 1e5;
    while (rk - lk > 1e-7){
        double mid = (lk + rk) / 2;
        if (check(mid) >= s) rk = mid;
        else lk = mid;
    }
    cout << lk;
}
signed main(){
    ios::sync_with_stdio(0);cin.tie(0);
    cout << fixed << setprecision(10);
    // int T=1;cin>>T;while(T--)
    solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3756kb

input:

11

output:

2.2360679395

result:

ok found '2.2360679', expected '2.2360680', error '0.0000000'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3920kb

input:

59

output:

4.9999999646

result:

ok found '5.0000000', expected '5.0000000', error '0.0000000'

Test #3:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

1

output:

1.4142135115

result:

ok found '1.4142135', expected '1.4142136', error '0.0000000'

Test #4:

score: 0
Accepted
time: 1ms
memory: 3724kb

input:

2

output:

1.4142135115

result:

ok found '1.4142135', expected '1.4142136', error '0.0000000'

Test #5:

score: 0
Accepted
time: 1ms
memory: 3784kb

input:

3

output:

1.4142135115

result:

ok found '1.4142135', expected '1.4142136', error '0.0000000'

Test #6:

score: -100
Wrong Answer
time: 1ms
memory: 3924kb

input:

4

output:

1.4142135115

result:

wrong answer 1st numbers differ - expected: '2.2360680', found: '1.4142135', error = '0.3675445'