QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#812859#2303. Lucky ShirtSGColinAC ✓25ms11756kbC++20822b2024-12-13 19:06:592024-12-13 19:07:15

Judging History

This is the latest submission verdict.

  • [2024-12-13 19:07:15]
  • Judged
  • Verdict: AC
  • Time: 25ms
  • Memory: 11756kb
  • [2024-12-13 19:06:59]
  • Submitted

answer

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

#define fr first
#define sc second
#define pb push_back
#define mp make_pair

typedef long long ll;
typedef pair<int, int> pii;

inline ll rd() {
	ll x = 0;
	bool f = 0;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) f |= (c == '-');
	for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
	return f ? -x : x;
}

double fpow(double x, int t) {
	double res = 1.0;
	for (; t; t >>= 1, x = x * x)
		if (t & 1) res = res * x;
	return res;
}

#define N 1000007

double f[N];

int main() {
	int n = rd(), p = rd(), k = rd();
	for (int i = 1; i <= n + 1; ++i) 
		f[i] = fpow(1.0 * (i - 1) / n, k);
	double ans = p * f[p];
	for (int i = p; i <= n; ++i) ans += (i + 1) * 0.5 * (f[i + 1] - f[i]);
	printf("%.10lf\n", ans);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 20ms
memory: 11612kb

input:

1000000 1000000 1000000

output:

683939.9446707639

result:

ok found '683939.9446708', expected '683939.9446710', error '0.0000000'

Test #2:

score: 0
Accepted
time: 11ms
memory: 11692kb

input:

1000000 1000000 1037

output:

999481.7690085791

result:

ok found '999481.7690086', expected '999481.7690090', error '0.0000000'

Test #3:

score: 0
Accepted
time: 22ms
memory: 11616kb

input:

1000000 12 1000000

output:

500000.2090121447

result:

ok found '500000.2090121', expected '500000.2090120', error '0.0000000'

Test #4:

score: 0
Accepted
time: 6ms
memory: 11732kb

input:

1000000 237 85

output:

494186.7965080864

result:

ok found '494186.7965081', expected '494186.7965080', error '0.0000000'

Test #5:

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

input:

106 45 1000000

output:

53.5000000000

result:

ok found '53.5000000', expected '53.5000000', error '0.0000000'

Test #6:

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

input:

50 37 100

output:

25.4240931792

result:

ok found '25.4240932', expected '25.4240932', error '0.0000000'

Test #7:

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

input:

21686 3046 995802

output:

10843.5000000000

result:

ok found '10843.5000000', expected '10843.5000000', error '0.0000000'

Test #8:

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

input:

39229 8742 997007

output:

19615.0000000000

result:

ok found '19615.0000000', expected '19615.0000000', error '0.0000000'

Test #9:

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

input:

148554 16724 999818

output:

74277.4994022326

result:

ok found '74277.4994022', expected '74277.4994022', error '0.0000000'

Test #10:

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

input:

80456 71487 995120

output:

40228.4999978750

result:

ok found '40228.4999979', expected '40228.4999979', error '0.0000000'

Test #11:

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

input:

117463 21766 997364

output:

58731.9998973162

result:

ok found '58731.9998973', expected '58731.9998973', error '0.0000000'

Test #12:

score: 0
Accepted
time: 24ms
memory: 11756kb

input:

999503 76758 307028

output:

499750.6095195970

result:

ok found '499750.6095196', expected '499750.6095200', error '0.0000000'

Test #13:

score: 0
Accepted
time: 15ms
memory: 11696kb

input:

994858 683723 5182

output:

497333.7766014124

result:

ok found '497333.7766014', expected '497333.7766010', error '0.0000000'

Test #14:

score: 0
Accepted
time: 25ms
memory: 11532kb

input:

997293 36211 244780

output:

498645.2026706365

result:

ok found '498645.2026706', expected '498645.2026710', error '0.0000000'

Test #15:

score: 0
Accepted
time: 21ms
memory: 11608kb

input:

991863 65853 526084

output:

495931.2853197203

result:

ok found '495931.2853197', expected '495931.2853200', error '0.0000000'

Test #16:

score: 0
Accepted
time: 24ms
memory: 11628kb

input:

994039 753788 273551

output:

497018.4216376413

result:

ok found '497018.4216376', expected '497018.4216380', error '0.0000000'

Test #17:

score: 0
Accepted
time: 18ms
memory: 11236kb

input:

958204 885361 135247

output:

479099.2017246630

result:

ok found '479099.2017247', expected '479099.2017250', error '0.0000000'

Test #18:

score: 0
Accepted
time: 7ms
memory: 6660kb

input:

297436 61097 444330

output:

148718.3552531778

result:

ok found '148718.3552532', expected '148718.3552530', error '0.0000000'

Test #19:

score: 0
Accepted
time: 12ms
memory: 10888kb

input:

768783 189461 884754

output:

384391.7686131534

result:

ok found '384391.7686132', expected '384391.7686130', error '0.0000000'

Test #20:

score: 0
Accepted
time: 8ms
memory: 7320kb

input:

435555 413369 655561

output:

217777.8573340476

result:

ok found '217777.8573340', expected '217777.8573340', error '0.0000000'

Test #21:

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

input:

122448 112932 844422

output:

61224.4994936748

result:

ok found '61224.4994937', expected '61224.4994937', error '0.0000000'

Test #22:

score: 0
Accepted
time: 12ms
memory: 11500kb

input:

896568 62973 576

output:

447507.8279628325

result:

ok found '447507.8279628', expected '447507.8279630', error '0.0000000'

Test #23:

score: 0
Accepted
time: 10ms
memory: 10952kb

input:

708723 316081 882

output:

353960.9345461076

result:

ok found '353960.9345461', expected '353960.9345460', error '0.0000000'

Test #24:

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

input:

469986 288497 752

output:

234681.6742361198

result:

ok found '234681.6742361', expected '234681.6742360', error '0.0000000'

Test #25:

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

input:

559630 106765 24

output:

268623.1499982140

result:

ok found '268623.1499982', expected '268623.1499980', error '0.0000000'

Test #26:

score: 0
Accepted
time: 12ms
memory: 11524kb

input:

917620 902513 679

output:

458141.7778092863

result:

ok found '458141.7778093', expected '458141.7778090', error '0.0000000'

Test #27:

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

input:

55994 5 897051

output:

27997.4999999449

result:

ok found '27997.4999999', expected '27997.4999999', error '0.0000000'

Test #28:

score: 0
Accepted
time: 13ms
memory: 10132kb

input:

561712 11 276799

output:

280855.7148970470

result:

ok found '280855.7148970', expected '280855.7148970', error '0.0000000'

Test #29:

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

input:

144541 4 482923

output:

72270.9816513503

result:

ok found '72270.9816514', expected '72270.9816514', error '0.0000000'

Test #30:

score: 0
Accepted
time: 17ms
memory: 10968kb

input:

775447 6 189129

output:

387722.1898106848

result:

ok found '387722.1898107', expected '387722.1898110', error '0.0000000'

Test #31:

score: 0
Accepted
time: 10ms
memory: 8488kb

input:

473744 1 257880

output:

236871.8088980077

result:

ok found '236871.8088980', expected '236871.8088980', error '0.0000000'

Test #32:

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

input:

146665 231 17

output:

69259.2222173926

result:

ok found '69259.2222174', expected '69259.2222174', error '0.0000000'

Test #33:

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

input:

182820 164 21

output:

87255.7499952141

result:

ok found '87255.7499952', expected '87255.7499952', error '0.0000000'

Test #34:

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

input:

57701 34 58

output:

28362.2584326937

result:

ok found '28362.2584327', expected '28362.2584327', error '0.0000000'

Test #35:

score: 0
Accepted
time: 5ms
memory: 10408kb

input:

688027 94 69

output:

339099.7714243933

result:

ok found '339099.7714244', expected '339099.7714240', error '0.0000000'

Test #36:

score: 0
Accepted
time: 5ms
memory: 10236kb

input:

686925 88 73

output:

338821.8648604367

result:

ok found '338821.8648604', expected '338821.8648600', error '0.0000000'

Test #37:

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

input:

13 13 553768

output:

7.0000000000

result:

ok found '7.0000000', expected '7.0000000', error '0.0000000'

Test #38:

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

input:

59 31 791280

output:

30.0000000000

result:

ok found '30.0000000', expected '30.0000000', error '0.0000000'

Test #39:

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

input:

2 1 356578

output:

1.5000000000

result:

ok found '1.5000000', expected '1.5000000', error '0.0000000'

Test #40:

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

input:

60 35 892955

output:

30.5000000000

result:

ok found '30.5000000', expected '30.5000000', error '0.0000000'

Test #41:

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

input:

56 16 895986

output:

28.5000000000

result:

ok found '28.5000000', expected '28.5000000', error '0.0000000'

Test #42:

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

input:

10 6 78

output:

5.4998651254

result:

ok found '5.4998651', expected '5.4998651', error '0.0000000'

Test #43:

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

input:

15 13 60

output:

7.9919510173

result:

ok found '7.9919510', expected '7.9919510', error '0.0000000'

Test #44:

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

input:

29 26 53

output:

14.9140837633

result:

ok found '14.9140838', expected '14.9140838', error '0.0000000'

Test #45:

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

input:

45 20 8

output:

20.7535266330

result:

ok found '20.7535266', expected '20.7535266', error '0.0000000'

Test #46:

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

input:

31 11 20

output:

15.4851814178

result:

ok found '15.4851814', expected '15.4851814', error '0.0000000'

Test #47:

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

input:

1 1 55

output:

1.0000000000

result:

ok found '1.0000000', expected '1.0000000', error '0.0000000'