QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#208317#5152. Circular Caramel CookieAeren#WA 2ms3980kbC++20625b2023-10-09 13:34:382023-10-09 13:34:39

Judging History

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

  • [2023-10-09 13:34:39]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3980kb
  • [2023-10-09 13:34:38]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

#define ll long long

int main()
{
	cin.tie(0)->sync_with_stdio(false);
	cin.exceptions(ios::badbit | ios::failbit);
	cout << fixed << setprecision(15);
	int th;
	cin >> th;
	auto cnt = [&](double r){
		long long res = 0;
		for(auto x = 1; x <= r; ++ x){
			res += sqrt(max(0.0, r * r - 1.0 * x * x));
		}
		return 4 * res;
	};
	double low = 0, high = 300000;
	for(auto rep = 300; rep > 0; -- rep){
		double mid = (low + high) / 2;
		if(cnt(mid) < th){
			low = mid;
		}
		else{
			high = mid;
		}
	}
	cout << (low + high) / 2 << "\n";
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3876kb

input:

11

output:

2.236067977499790

result:

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

Test #2:

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

input:

59

output:

5.000000000000000

result:

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

Test #3:

score: 0
Accepted
time: 2ms
memory: 3876kb

input:

1

output:

1.414213562373095

result:

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

Test #4:

score: 0
Accepted
time: 2ms
memory: 3936kb

input:

2

output:

1.414213562373095

result:

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

Test #5:

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

input:

3

output:

1.414213562373095

result:

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

Test #6:

score: -100
Wrong Answer
time: 2ms
memory: 3936kb

input:

4

output:

1.414213562373095

result:

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