QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#186750#5152. Circular Caramel CookieForever_Young#WA 2ms3952kbC++14516b2023-09-24 11:11:332023-09-24 11:11:34

Judging History

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

  • [2023-09-24 11:11:34]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3952kb
  • [2023-09-24 11:11:33]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
typedef double D;
typedef long long LL;
int main() {
	int s;
	scanf("%d", &s);
	D le = 0, ri = 1e6;
	for(int i = 0; i < 80; i++) {
		D mid = (le + ri) / 2;
		LL cnt = 0;
		D sq = mid * mid;
		for(LL j = 0; j + 1 < mid; j++) {
			D rmn = sq - (j + 1) * (j + 1);
			cnt += (LL)sqrt(rmn);
		}
		if(cnt * 4 >= s) {
			ri = mid;
		}else {
			le = mid;
		}
	}
	printf("%.12f\n", (double)le);
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

11

output:

2.236067977500

result:

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

Test #2:

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

input:

59

output:

5.000000000000

result:

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

Test #3:

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

input:

1

output:

1.414213562373

result:

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

Test #4:

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

input:

2

output:

1.414213562373

result:

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

Test #5:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

3

output:

1.414213562373

result:

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

Test #6:

score: -100
Wrong Answer
time: 0ms
memory: 3932kb

input:

4

output:

1.414213562373

result:

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