QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#96285#5152. Circular Caramel CookieSa3tElSefr#WA 37ms17108kbC++141.6kb2023-04-13 18:43:432023-04-13 18:43:46

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-13 18:43:46]
  • 评测
  • 测评结果:WA
  • 用时:37ms
  • 内存:17108kb
  • [2023-04-13 18:43:43]
  • 提交

answer

///Etfsh5t nseet el rank
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include "bits/stdc++.h"
using namespace std;

#define pb push_back
#define F first
#define S second
#define f(i, a, b) for (int i = a; i < b; i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(x) (int)(x).size()
#define mp(x, y) make_pair(x, y)
#define popCnt(x) (__builtin_popcountll(x))
// #define int ll

using ll = long long;
using ull = unsigned long long;
using uint = uint32_t;
using ii = pair<int, int>;

const int N = 3e5 + 5, A = 12, LG = 18, MOD = (119 << 23) + 1;
const long double PI = acos(-1);
const long double EPS = 1e-9;
const int INF = 1e18;
vector<int> divos[100005];
string val[100005];
long long calc(long double md)
{
    long long ans = 0;
    for (int i = 1; i <= md; i++)
    {
        ans += (ll)sqrt(md * md - i * i);
    }
    return ans;
}
void doWork()
{
    int s;
    cin >> s;
    long double lo = 0, hi = 1e5;
    f(i, 0, 500)
    {
        long double md = (lo + hi) / 2.0;
        if (4 * calc(md) >= s - 1)
            hi = md;
        else
            lo = md;
    }
    cout << fixed << setprecision(10) << lo << endl;
}
int32_t main()
{
#ifdef ONLINE_JUDGE
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif // ONLINE_JUDGE

    for (int i = 1; i <= 100000; i++)
        for (int j = i; j <= 100000; j += i)
            divos[j].push_back(i);

    int t = 1;
    // cin >> t;
    while (t--)
    {
        doWork();
    }
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 32ms
memory: 17108kb

input:

11

output:

2.2360679775

result:

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

Test #2:

score: 0
Accepted
time: 37ms
memory: 17088kb

input:

59

output:

5.0000000000

result:

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

Test #3:

score: -100
Wrong Answer
time: 36ms
memory: 17092kb

input:

1

output:

0.0000000000

result:

wrong answer 1st numbers differ - expected: '1.4142136', found: '0.0000000', error = '1.0000000'