QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#606613#5557. Enjoyable Entreewhale_island#AC ✓18ms10744kbPython3644b2024-10-03 11:00:132024-10-03 11:00:15

Judging History

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

  • [2024-10-03 11:00:15]
  • 评测
  • 测评结果:AC
  • 用时:18ms
  • 内存:10744kb
  • [2024-10-03 11:00:13]
  • 提交

answer

def pluss(x,y):
    z = [[0 for i in range(2)] for j in range(2)]
    for i in range(2):
        for j in range(2):
            for k in range(2):
                z[i][j] += x[i][k]*y[k][j]
    return z
def qpow(x, y):
    if y == 1:
        return x
    if y == 2:
        return pluss(x,x)
    tmp = qpow(x,y//2)
    if y%2 == 1:
        return pluss(tmp,pluss(tmp,x))
    return pluss(tmp,tmp)
n = int(input())
a = [[0.5,0.5],[1,0]]
if n == 1:
    print("100.0 0.0")
elif n==2:
    print("0.0 100.0")
elif n==3:
    print("50.0 50.0")
else:
    b = qpow(a,n-2)

    print("%10f %10f"%((b[0][1])*100,(b[0][0])*100))

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 12ms
memory: 10712kb

input:

1

output:

100.0 0.0

result:

ok 2 numbers

Test #2:

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

input:

3

output:

50.0 50.0

result:

ok 2 numbers

Test #3:

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

input:

7

output:

 34.375000  65.625000

result:

ok 2 numbers

Test #4:

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

input:

2

output:

0.0 100.0

result:

ok 2 numbers

Test #5:

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

input:

4

output:

 25.000000  75.000000

result:

ok 2 numbers

Test #6:

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

input:

5

output:

 37.500000  62.500000

result:

ok 2 numbers

Test #7:

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

input:

6

output:

 31.250000  68.750000

result:

ok 2 numbers

Test #8:

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

input:

8

output:

 32.812500  67.187500

result:

ok 2 numbers

Test #9:

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

input:

9

output:

 33.593750  66.406250

result:

ok 2 numbers

Test #10:

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

input:

10

output:

 33.203125  66.796875

result:

ok 2 numbers

Test #11:

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

input:

11

output:

 33.398438  66.601562

result:

ok 2 numbers

Test #12:

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

input:

12

output:

 33.300781  66.699219

result:

ok 2 numbers

Test #13:

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

input:

13

output:

 33.349609  66.650391

result:

ok 2 numbers

Test #14:

score: 0
Accepted
time: 14ms
memory: 10712kb

input:

14

output:

 33.325195  66.674805

result:

ok 2 numbers

Test #15:

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

input:

15

output:

 33.337402  66.662598

result:

ok 2 numbers

Test #16:

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

input:

16

output:

 33.331299  66.668701

result:

ok 2 numbers

Test #17:

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

input:

17

output:

 33.334351  66.665649

result:

ok 2 numbers

Test #18:

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

input:

18

output:

 33.332825  66.667175

result:

ok 2 numbers

Test #19:

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

input:

19

output:

 33.333588  66.666412

result:

ok 2 numbers

Test #20:

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

input:

20

output:

 33.333206  66.666794

result:

ok 2 numbers

Test #21:

score: 0
Accepted
time: 14ms
memory: 10552kb

input:

21

output:

 33.333397  66.666603

result:

ok 2 numbers

Test #22:

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

input:

22

output:

 33.333302  66.666698

result:

ok 2 numbers

Test #23:

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

input:

23

output:

 33.333349  66.666651

result:

ok 2 numbers

Test #24:

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

input:

24

output:

 33.333325  66.666675

result:

ok 2 numbers

Test #25:

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

input:

25

output:

 33.333337  66.666663

result:

ok 2 numbers

Test #26:

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

input:

26

output:

 33.333331  66.666669

result:

ok 2 numbers

Test #27:

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

input:

27

output:

 33.333334  66.666666

result:

ok 2 numbers

Test #28:

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

input:

28

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #29:

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

input:

29

output:

 33.333334  66.666666

result:

ok 2 numbers

Test #30:

score: 0
Accepted
time: 14ms
memory: 10600kb

input:

30

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #31:

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

input:

645

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #32:

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

input:

9664

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #33:

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

input:

92124

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #34:

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

input:

655217

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #35:

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

input:

1906604

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #36:

score: 0
Accepted
time: 14ms
memory: 10704kb

input:

14158782

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #37:

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

input:

118145010

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #38:

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

input:

2200494025

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #39:

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

input:

43605764225

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #40:

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

input:

804695488029

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #41:

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

input:

6627335577483

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #42:

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

input:

63784486977434

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #43:

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

input:

162874566997492

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #44:

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

input:

7889646630282564

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #45:

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

input:

93757501737327402

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #46:

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

input:

633156281075725080

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #47:

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

input:

999999999999999999

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #48:

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

input:

1000000000000000000

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #49:

score: 0
Accepted
time: 14ms
memory: 10692kb

input:

2147483646

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #50:

score: 0
Accepted
time: 14ms
memory: 10724kb

input:

2147483647

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #51:

score: 0
Accepted
time: 14ms
memory: 10584kb

input:

2147483648

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #52:

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

input:

2147483649

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #53:

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

input:

4294967294

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #54:

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

input:

4294967295

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #55:

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

input:

4294967296

output:

 33.333333  66.666667

result:

ok 2 numbers

Test #56:

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

input:

4294967297

output:

 33.333333  66.666667

result:

ok 2 numbers