QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#96325 | #5152. Circular Caramel Cookie | IsaacMoris# | WA | 2ms | 3580kb | C++14 | 832b | 2023-04-13 19:35:45 | 2023-04-13 19:35:48 |
Judging History
answer
#include<iostream>
#include <bits/stdc++.h>
# define ld long double
#define ll long long
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int N = 1e6 + 5, mod = 998244353, M = 17;
ll solve(ld r) {
// x^2 + y^2 <= r2
ll ans = 0;
for (int i = -r; i <= r; i++) {
if (i == 0)continue;
int y = sqrt(r * r - 1ll * i * i);
ans += 2 * y;
}
return ans;
}
void doWork() {
int s;
cin >> s;
ld ans = 0;
for (ld i = 2e4; i >= 1e-9; i /= 2) {
while (solve(ans + i) < s) {
ans += i;
}
}
cout << fixed << setprecision(9) << ans << " " << solve(ans);
}
int main() {
IO
int t = 1;
// cin >> t;
for (int i = 1; i <= t; i++) {
doWork();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3580kb
input:
11
output:
2.236067977 4
result:
wrong output format Extra information in the output file