CSES - Datatähti 2018 alku - Results
Submission details
Task:Fraktaali
Sender:soap
Submission time:2017-10-02 03:05:00 +0300
Language:Python3
Status:READY
Result:20
Feedback
groupverdictscore
#1ACCEPTED10
#2ACCEPTED10
#30
#40
#50
#60
#70
#80
#90
#100
Test results
testverdicttimegroup
#1ACCEPTED0.06 s1details
#2ACCEPTED0.07 s2details
#30.07 s3details
#40.09 s4details
#50.07 s5details
#60.06 s6details
#70.07 s7details
#80.07 s8details
#90.07 s9details
#100.07 s10details

Code

frac = [[0 for x in range(2)] for y in range(2)]
frac[1][1] = 1

def main():
    count = input()

    if(count == "1"):
        print("#")
        return
    if(count == "2"):
        print_frac(frac)
        return

    print_frac(gen_frac(count))

def print_frac(frac):
    for row in frac:
        for val in row:
            print(str(val).replace('1','.').replace('0', '#'), end='')
        print()

def gen_frac(c):
    g_size = 2**c #gridsize
    inv_frac = invert_frac(frac)

    for x in range(0, g_size/2-1):
        pass
    


def invert_frac(frac):
    for x in range(len(frac)):
        for y in range(len(frac)):
            frac[x][y] = 1-frac[x][y]
    return frac



main()

Test details

Test 1

Group: 1

Verdict: ACCEPTED

input
1

correct output
#

user output
#

Test 2

Group: 2

Verdict: ACCEPTED

input
2

correct output
##
#.

user output
##
#.

Test 3

Group: 3

Verdict:

input
3

correct output
####
#.#.
##..
#..#

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 39, in <module>
    main()
  File "input/code.py", line 14, in main
    print_frac(gen_frac(count))
  File "input/code.py", line 23, in gen_frac
    g_size = 2**c #gridsize
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'

Test 4

Group: 4

Verdict:

input
4

correct output
########
#.#.#.#.
##..##..
#..##..#
####....
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 39, in <module>
    main()
  File "input/code.py", line 14, in main
    print_frac(gen_frac(count))
  File "input/code.py", line 23, in gen_frac
    g_size = 2**c #gridsize
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'

Test 5

Group: 5

Verdict:

input
5

correct output
################
#.#.#.#.#.#.#.#.
##..##..##..##..
#..##..##..##..#
####....####....
...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 39, in <module>
    main()
  File "input/code.py", line 14, in main
    print_frac(gen_frac(count))
  File "input/code.py", line 23, in gen_frac
    g_size = 2**c #gridsize
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'

Test 6

Group: 6

Verdict:

input
6

correct output
##############################...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 39, in <module>
    main()
  File "input/code.py", line 14, in main
    print_frac(gen_frac(count))
  File "input/code.py", line 23, in gen_frac
    g_size = 2**c #gridsize
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'

Test 7

Group: 7

Verdict:

input
7

correct output
##############################...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 39, in <module>
    main()
  File "input/code.py", line 14, in main
    print_frac(gen_frac(count))
  File "input/code.py", line 23, in gen_frac
    g_size = 2**c #gridsize
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'

Test 8

Group: 8

Verdict:

input
8

correct output
##############################...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 39, in <module>
    main()
  File "input/code.py", line 14, in main
    print_frac(gen_frac(count))
  File "input/code.py", line 23, in gen_frac
    g_size = 2**c #gridsize
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'

Test 9

Group: 9

Verdict:

input
9

correct output
##############################...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 39, in <module>
    main()
  File "input/code.py", line 14, in main
    print_frac(gen_frac(count))
  File "input/code.py", line 23, in gen_frac
    g_size = 2**c #gridsize
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'

Test 10

Group: 10

Verdict:

input
10

correct output
##############################...

user output
(empty)

Error:
Traceback (most recent call last):
  File "input/code.py", line 39, in <module>
    main()
  File "input/code.py", line 14, in main
    print_frac(gen_frac(count))
  File "input/code.py", line 23, in gen_frac
    g_size = 2**c #gridsize
TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'str'