CSES - Datatähti 2018 alku - Results
Submission details
Task:Fraktaali
Sender:Hege
Submission time:2017-10-11 17:13:24 +0300
Language:Python3
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED10
#2ACCEPTED10
#3ACCEPTED10
#4ACCEPTED10
#5ACCEPTED10
#6ACCEPTED10
#7ACCEPTED10
#8ACCEPTED10
#9ACCEPTED10
#10ACCEPTED10
Test results
testverdicttimegroup
#1ACCEPTED0.08 s1details
#2ACCEPTED0.08 s2details
#3ACCEPTED0.08 s3details
#4ACCEPTED0.07 s4details
#5ACCEPTED0.08 s5details
#6ACCEPTED0.07 s6details
#7ACCEPTED0.05 s7details
#8ACCEPTED0.08 s8details
#9ACCEPTED0.07 s9details
#10ACCEPTED0.10 s10details

Code

### FRAKTAALI (dt2k18) ###
# this time lets obey the namespaces a bit :D quz lol
# we'll use this f() function to do a round
def f(a):
# take the current f stage
l = a[0].bit_length()
# make new hash
b = {}
# lets make the inverted thing
inv = [i ^ 2**l-1 for i in a.values()]
# then start filling the hash
# .items() means to have also index in hand
# lol pyton php'd do this with only a overloaded syntax
# pyton y u hate chewing gum
for i, row in a.items():
b[i] = row
b[i] <<= l
b[i] += row
# second stage in filling
for i, row in a.items():
b[i+l] = row
b[i+l] <<= l
b[i+l] += inv[i]
return b
def main(n):
# let's start this with n=1
a = {0: 1}
# do teh rounds
for i in range(1, n):
# lol this looks so simpel
a = f(a)
# output the result
# use our very h4x lang puke
for i in [bin(i)[2:] for i in a.values()]:
# ord("0") == 48 and ord("1") == 49
print(i.translate({48: ".", 49: "#"}))
# with this line u could see what ints it has
# but no, its not in the spec >:3
# print(repr(list(a.values())))
# somehow pyytton likes this thing as module aware lang
if __name__ == "__main__":
main(int(input()))

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: ACCEPTED

input
3

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

user output
####
#.#.
##..
#..#

Test 4

Group: 4

Verdict: ACCEPTED

input
4

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

user output
########
#.#.#.#.
##..##..
#..##..#
####....
...

Test 5

Group: 5

Verdict: ACCEPTED

input
5

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

user output
################
#.#.#.#.#.#.#.#.
##..##..##..##..
#..##..##..##..#
####....####....
...

Test 6

Group: 6

Verdict: ACCEPTED

input
6

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

user output
##############################...

Test 7

Group: 7

Verdict: ACCEPTED

input
7

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

user output
##############################...

Test 8

Group: 8

Verdict: ACCEPTED

input
8

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

user output
##############################...

Test 9

Group: 9

Verdict: ACCEPTED

input
9

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

user output
##############################...

Test 10

Group: 10

Verdict: ACCEPTED

input
10

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

user output
##############################...