QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#180105#7247. Hans Zimmerxaphoenix#WA 9ms8284kbC++141.6kb2023-09-15 15:45:162023-09-15 15:45:17

Judging History

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

  • [2023-09-15 15:45:17]
  • 评测
  • 测评结果:WA
  • 用时:9ms
  • 内存:8284kb
  • [2023-09-15 15:45:16]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define LC k<<1
#define RC k<<1|1
#define IO cin.sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repn(i, a, n) for (int i = a; i <= n; i++)
#define per(i, a, n) for (int i = (n) - 1; i >= a; i--)
#define pern(i, a, n) for (int i = n; i >= a; i--)

typedef long long LL;
typedef long double LD;
typedef unsigned long long ull;
typedef pair<int, int> PII;
typedef pair<int, LL> PIL;
typedef pair<LL, int> PLI;
typedef pair<double, double> PDD;
typedef pair<ull, ull> PUU;
typedef pair<LL, LL> PLL;

const int N = 1100000;
const int M = 1100000;
const int mod = 1e9+7;
const int inf = (int)1e9;
const LL INF = 1e18;
const double eps = 1e-9;

mt19937_64 Rand((unsigned long long)new char);
#define rand Rand


int n, cnt[N];
LD w, h;
int main() {
	IO;
	cin >> w >> h >> n;
	LD ans = 0;
	int st = max(n / 2 - 25, 0), ed = min(n / 2 + 25, n);
	repn(i, st, ed) {
		memset(cnt, 0, sizeof(cnt));
		repn(j, 0, i) {
			cnt[j] = n / (i + 1);
			if (n % (i + 1) > j) cnt[j]++;
		}
		LD p = w * h;
		repn(j, 1, cnt[0]) p = p / 2.0;
		repn(j, 1, i) {
			p = p * (n - j + 1) / j;
			repn(k, 1, cnt[j]) p = p / 2.0;
		}
		p /= (i + 1);
		p /= (i + 1);
		p /= (n - i + 1);
		p /= (n - i + 1);
		ans += p;
	}
	cout << fixed << setprecision(15) << (double)ans << "\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2 4 1

output:

2.000000000000000

result:

ok jury = 2, participant = 2, relative error = 0

Test #2:

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

input:

42 24 2

output:

87.500000000000000

result:

ok jury = 87.5, participant = 87.5, relative error = 0

Test #3:

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

input:

1 1 5

output:

0.009201388888889

result:

ok jury = 0.009201388889, participant = 0.009201388889, relative error = 1.206336917e-11

Test #4:

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

input:

1 1 1

output:

0.250000000000000

result:

ok jury = 0.25, participant = 0.25, relative error = 0

Test #5:

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

input:

1 1000 1

output:

250.000000000000000

result:

ok jury = 250, participant = 250, relative error = 0

Test #6:

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

input:

1000 1 1

output:

250.000000000000000

result:

ok jury = 250, participant = 250, relative error = 0

Test #7:

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

input:

1000 1000 1

output:

250000.000000000000000

result:

ok jury = 250000, participant = 250000, relative error = 0

Test #8:

score: 0
Accepted
time: 3ms
memory: 8216kb

input:

1 1000 5

output:

9.201388888888889

result:

ok jury = 9.201388889, participant = 9.201388889, relative error = 1.20754727e-11

Test #9:

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

input:

1000 1000 5

output:

9201.388888888888687

result:

ok jury = 9201.388889, participant = 9201.388889, relative error = 1.207547579e-11

Test #10:

score: 0
Accepted
time: 3ms
memory: 8108kb

input:

1 1 10

output:

0.000939123342817

result:

ok jury = 0.0009391233428, participant = 0.0009391233428, relative error = 1.810195107e-11

Test #11:

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

input:

1 1 2

output:

0.086805555555556

result:

ok jury = 0.08680555556, participant = 0.08680555556, relative error = 5.119488833e-11

Test #12:

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

input:

1 1 3

output:

0.036458333333333

result:

ok jury = 0.03645833333, participant = 0.03645833333, relative error = 9.141944344e-11

Test #13:

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

input:

1 1 4

output:

0.017442129629630

result:

ok jury = 0.01744212963, participant = 0.01744212963, relative error = 2.12129584e-11

Test #14:

score: 0
Accepted
time: 9ms
memory: 8268kb

input:

1 1 100

output:

0.000000150787238

result:

ok jury = 1.507872879e-07, participant = 1.50787238e-07, relative error = 3.309297534e-07

Test #15:

score: 0
Accepted
time: 4ms
memory: 8208kb

input:

1000 1000 100

output:

0.150787237841714

result:

ok jury = 0.1507872879, participant = 0.1507872378, relative error = 3.319794839e-07

Test #16:

score: -100
Wrong Answer
time: 6ms
memory: 8216kb

input:

1 1 1000

output:

0.000000000014195

result:

wrong answer jury = 1.590439869e-11, participant = 1.4195e-11, relative error = 0.1074796176