QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#180122#7247. Hans Zimmerxaphoenix#WA 0ms4072kbC++141.5kb2023-09-15 15:53:502023-09-15 15:53:52

Judging History

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

  • [2023-09-15 15:53:52]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:4072kb
  • [2023-09-15 15:53:50]
  • 提交

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

const int L = 1;

int n;
LD w, h;
int main() {
	IO;
	cin >> w >> h >> n;
	LD ans = 0;
	int st = max(n / 2 - L, 0), ed = min(n / 2 + L, n);
	repn(i, st, ed) {
		LD p = w * h;
		int cnt = n;
		repn(j, 1, i) {
			p = p * (n - j + 1) / j;
			while (p > 1.0 && cnt) p /= 2, cnt--;
		}
		p *= pow(0.5, cnt);
		p /= (i + 1);
		p /= (i + 1);
		p /= (n - i + 1);
		p /= (n - i + 1);
		ans += p;
	}
	cout << fixed << setprecision(100) << (double)ans << "\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 4020kb

input:

2 4 1

output:

2.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

result:

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

Test #2:

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

input:

42 24 2

output:

87.5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

result:

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

Test #3:

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

input:

1 1 5

output:

0.0059027777777777776235801354687282582744956016540527343750000000000000000000000000000000000000000000

result:

wrong answer jury = 0.009201388889, participant = 0.005902777778, relative error = 0.358490566