QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#359976#5152. Circular Caramel Cookiekevinyang#WA 1ms3980kbC++17543b2024-03-21 07:55:432024-03-21 07:55:43

Judging History

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

  • [2024-03-21 07:55:43]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3980kb
  • [2024-03-21 07:55:43]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
	cin.tie(nullptr)->sync_with_stdio(false);
	int s;
	cin >> s;
	double low = 0; double high = 1e5;
	for(int iters = 0; iters < 70; iters++){
		double r = (low+high)/2;
		int ans = 0;
		for(int i = 1; i<=r; i++){
			//x^2 + y^2 = r^2
			// x = sqrt(r^2 - y^2);
			int v = sqrt(r*r - i*i);
			ans+=v*4;
		}
		if(ans>=s){
			high = r;
		}
		else{
			low = r;
		}
	}
	cout << fixed << setprecision(12);
	cout << high << '\n';
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3940kb

input:

11

output:

2.236067977500

result:

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

Test #2:

score: 0
Accepted
time: 1ms
memory: 3900kb

input:

59

output:

5.000000000000

result:

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

Test #3:

score: 0
Accepted
time: 1ms
memory: 3924kb

input:

1

output:

1.414213562373

result:

ok found '1.4142136', expected '1.4142136', error '0.0000000'

Test #4:

score: 0
Accepted
time: 1ms
memory: 3736kb

input:

2

output:

1.414213562373

result:

ok found '1.4142136', expected '1.4142136', error '0.0000000'

Test #5:

score: 0
Accepted
time: 1ms
memory: 3980kb

input:

3

output:

1.414213562373

result:

ok found '1.4142136', expected '1.4142136', error '0.0000000'

Test #6:

score: -100
Wrong Answer
time: 1ms
memory: 3856kb

input:

4

output:

1.414213562373

result:

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