QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#96285 | #5152. Circular Caramel Cookie | Sa3tElSefr# | WA | 37ms | 17108kb | C++14 | 1.6kb | 2023-04-13 18:43:43 | 2023-04-13 18:43:46 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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'