QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#456689#3219. ManhattanpropaneAC ✓0ms3968kbC++20605b2024-06-28 10:55:312024-06-28 10:55:31

Judging History

This is the latest submission verdict.

  • [2024-06-28 10:55:31]
  • Judged
  • Verdict: AC
  • Time: 0ms
  • Memory: 3968kb
  • [2024-06-28 10:55:31]
  • Submitted

answer

#include<iostream>
#include<cstring>
#include<vector>
#include<numbers>
#include<iomanip>
#include<cmath>
using namespace std;
using LL = long long;

int main(){

#ifdef LOCAL
    freopen("data.in", "r", stdin);
    freopen("data.out", "w", stdout);
#endif

    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(0);

    double x;
    cin >> x;
    double ans = x * numbers::sqrt2;
    for(int i = 1; i <= 10; i++){
        if (x >= i and x <= sqrt(i * i + 1)){
            ans = max(ans, i + 1.0);
        }
    }
    cout << fixed << setprecision(20) << ans << '\n';

}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3908kb

input:

1.414

output:

2.00000000000000000000

result:

ok found '2.000000000', expected '2.000000000', error '0.000000000'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3960kb

input:

1.415

output:

2.00111219075792989841

result:

ok found '2.001112191', expected '2.001112191', error '0.000000000'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

2.002

output:

3.00000000000000000000

result:

ok found '3.000000000', expected '3.000000000', error '0.000000000'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3968kb

input:

2.235

output:

3.16076731190386750470

result:

ok found '3.160767312', expected '3.160767312', error '0.000000000'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3924kb

input:

10.000

output:

14.14213562373095101066

result:

ok found '14.142135624', expected '14.142135624', error '0.000000000'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3860kb

input:

1.625

output:

2.29809703885627980569

result:

ok found '2.298097039', expected '2.298097039', error '0.000000000'

Test #7:

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

input:

0.996

output:

1.40855670812360278532

result:

ok found '1.408556708', expected '1.408556708', error '0.000000000'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

1.313

output:

2.00000000000000000000

result:

ok found '2.000000000', expected '2.000000000', error '0.000000000'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

2.107

output:

3.00000000000000000000

result:

ok found '3.000000000', expected '3.000000000', error '0.000000000'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

0.802

output:

1.13419927702322231866

result:

ok found '1.134199277', expected '1.134199277', error '0.000000000'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

4.581

output:

6.47851232923114928042

result:

ok found '6.478512329', expected '6.478512329', error '0.000000000'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3868kb

input:

9.172

output:

12.97116679408602912815

result:

ok found '12.971166794', expected '12.971166794', error '0.000000000'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3964kb

input:

5.039

output:

7.12622214079802596132

result:

ok found '7.126222141', expected '7.126222141', error '0.000000000'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3908kb

input:

3.845

output:

5.43765114732455145941

result:

ok found '5.437651147', expected '5.437651147', error '0.000000000'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

2.605

output:

3.68402632998191270630

result:

ok found '3.684026330', expected '3.684026330', error '0.000000000'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

1.000

output:

2.00000000000000000000

result:

ok found '2.000000000', expected '2.000000000', error '0.000000000'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

2.345

output:

3.31633080376490818608

result:

ok found '3.316330804', expected '3.316330804', error '0.000000000'