QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#201417 | #5152. Circular Caramel Cookie | Orange_JuiCE# | WA | 0ms | 3856kb | C++17 | 1.0kb | 2023-10-05 14:12:06 | 2023-10-05 14:12:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define rep(a, b, c) for(int (a)=(b);(a)<=(c);(a)++)
#define per(a, b, c) for(int (a)=(b);(a)>=(c);(a)--)
#define mset(var, val) memset(var,val,sizeof(var))
#define ll long long
#define fi first
#define se second
#define no "No\n"
#define yes "Yes\n"
#define pb push_back
#define endl "\n"
#define pii pair<int,int>
#define pll pair<ll,ll>
#define dbg(x...) do{cout<<#x<<" -> ";err(x);}while (0)
void err() { cout << '\n'; }
template<class T, class... Ts>
void err(T arg, Ts... args) {
cout << arg << ' ';
err(args...);
}
int n, a;
void solve() {
cin >> n;
a = sqrt(3+n)-1;
if(n == 1) {
printf("%.10lf\n", sqrt(0.5));
}
else
printf("%.10lf\n", sqrt(1.0*a*a/2.0+a+1));
// cout << a << endl;
}
int main() {
// IOS;
int T = 1;
// cin >> T;
while (T--) {
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3820kb
input:
11
output:
2.2360679775
result:
ok found '2.2360680', expected '2.2360680', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3856kb
input:
59
output:
5.0000000000
result:
ok found '5.0000000', expected '5.0000000', error '0.0000000'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3824kb
input:
1
output:
0.7071067812
result:
wrong answer 1st numbers differ - expected: '1.4142136', found: '0.7071068', error = '0.5000000'