QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#100467#5557. Enjoyable EntreePetroTarnavskyi#AC ✓5ms3684kbC++17696b2023-04-26 14:46:092023-04-26 14:46:14

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-26 14:46:14]
  • 评测
  • 测评结果:AC
  • 用时:5ms
  • 内存:3684kb
  • [2023-04-26 14:46:09]
  • 提交

answer

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

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(10);
	double f1 = 1, f2 = 0;
	LL n;
	cin >> n;
	n = min(n, 1000000LL);
	FOR(i, 0, n - 1) {
		double f3 = (f1 + f2) / 2;
		f1 = f2;
		f2 = f3;
	}
	cout << 100 * f1 << " " << 100 * (1 - f1) << "\n";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1

output:

100.0000000000 0.0000000000

result:

ok 2 numbers

Test #2:

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

input:

3

output:

50.0000000000 50.0000000000

result:

ok 2 numbers

Test #3:

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

input:

7

output:

34.3750000000 65.6250000000

result:

ok 2 numbers

Test #4:

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

input:

2

output:

0.0000000000 100.0000000000

result:

ok 2 numbers

Test #5:

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

input:

4

output:

25.0000000000 75.0000000000

result:

ok 2 numbers

Test #6:

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

input:

5

output:

37.5000000000 62.5000000000

result:

ok 2 numbers

Test #7:

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

input:

6

output:

31.2500000000 68.7500000000

result:

ok 2 numbers

Test #8:

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

input:

8

output:

32.8125000000 67.1875000000

result:

ok 2 numbers

Test #9:

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

input:

9

output:

33.5937500000 66.4062500000

result:

ok 2 numbers

Test #10:

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

input:

10

output:

33.2031250000 66.7968750000

result:

ok 2 numbers

Test #11:

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

input:

11

output:

33.3984375000 66.6015625000

result:

ok 2 numbers

Test #12:

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

input:

12

output:

33.3007812500 66.6992187500

result:

ok 2 numbers

Test #13:

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

input:

13

output:

33.3496093750 66.6503906250

result:

ok 2 numbers

Test #14:

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

input:

14

output:

33.3251953125 66.6748046875

result:

ok 2 numbers

Test #15:

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

input:

15

output:

33.3374023438 66.6625976562

result:

ok 2 numbers

Test #16:

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

input:

16

output:

33.3312988281 66.6687011719

result:

ok 2 numbers

Test #17:

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

input:

17

output:

33.3343505859 66.6656494141

result:

ok 2 numbers

Test #18:

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

input:

18

output:

33.3328247070 66.6671752930

result:

ok 2 numbers

Test #19:

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

input:

19

output:

33.3335876465 66.6664123535

result:

ok 2 numbers

Test #20:

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

input:

20

output:

33.3332061768 66.6667938232

result:

ok 2 numbers

Test #21:

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

input:

21

output:

33.3333969116 66.6666030884

result:

ok 2 numbers

Test #22:

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

input:

22

output:

33.3333015442 66.6666984558

result:

ok 2 numbers

Test #23:

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

input:

23

output:

33.3333492279 66.6666507721

result:

ok 2 numbers

Test #24:

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

input:

24

output:

33.3333253860 66.6666746140

result:

ok 2 numbers

Test #25:

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

input:

25

output:

33.3333373070 66.6666626930

result:

ok 2 numbers

Test #26:

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

input:

26

output:

33.3333313465 66.6666686535

result:

ok 2 numbers

Test #27:

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

input:

27

output:

33.3333343267 66.6666656733

result:

ok 2 numbers

Test #28:

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

input:

28

output:

33.3333328366 66.6666671634

result:

ok 2 numbers

Test #29:

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

input:

29

output:

33.3333335817 66.6666664183

result:

ok 2 numbers

Test #30:

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

input:

30

output:

33.3333332092 66.6666667908

result:

ok 2 numbers

Test #31:

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

input:

645

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #32:

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

input:

9664

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #33:

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

input:

92124

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #34:

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

input:

655217

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #35:

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

input:

1906604

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #36:

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

input:

14158782

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #37:

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

input:

118145010

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #38:

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

input:

2200494025

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #39:

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

input:

43605764225

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #40:

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

input:

804695488029

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #41:

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

input:

6627335577483

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #42:

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

input:

63784486977434

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #43:

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

input:

162874566997492

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #44:

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

input:

7889646630282564

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #45:

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

input:

93757501737327402

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #46:

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

input:

633156281075725080

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #47:

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

input:

999999999999999999

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #48:

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

input:

1000000000000000000

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #49:

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

input:

2147483646

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #50:

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

input:

2147483647

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #51:

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

input:

2147483648

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #52:

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

input:

2147483649

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #53:

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

input:

4294967294

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #54:

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

input:

4294967295

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #55:

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

input:

4294967296

output:

33.3333333333 66.6666666667

result:

ok 2 numbers

Test #56:

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

input:

4294967297

output:

33.3333333333 66.6666666667

result:

ok 2 numbers