QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#501186#5152. Circular Caramel CookiessmyWA 0ms3884kbC++20789b2024-08-02 15:27:512024-08-02 15:27:52

Judging History

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

  • [2024-08-02 15:27:52]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3884kb
  • [2024-08-02 15:27:51]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long

void solve()
{
    int n;
    std:: cin >> n;
    int x = 4;
    double ans;
    for(int i = x; ;i ++ )
    {
        if(i * i > n)
        {
            if(i % 2 == 0)
            {
                ans = sqrt((i / 2) * (i / 2) + (i / 2 - 1) * (i / 2 - 1));
                break;
            }
            else
            {
                ans = sqrt((i / 2 + 0.5) * (i / 2 + 0.5) + (i / 2 - 1 + 0.5) * (i / 2 - 1 + 0.5));
                break;
            }
        }
    }
    std:: cout << setprecision(10) << ans << endl;
}
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
    // int T;
    // std:: cin >> T;
    // while(T -- )
	solve();
	return 0;
}

詳細信息

Test #1:

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

input:

11

output:

2.236067977

result:

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

Test #2:

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

input:

59

output:

5

result:

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

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3832kb

input:

1

output:

2.236067977

result:

wrong answer 1st numbers differ - expected: '1.4142136', found: '2.2360680', error = '0.5811388'