DatatÃ¤hti 2018 alku

 Start: 2017-10-02 00:00:00 End: 2017-10-16 00:00:00

CSES - DatatÃ¤hti 2018 alku - Results
History
2017-10-02 15:54:12100
2017-10-02 15:51:350
 Task: Fraktaali Sender: Shrike Submission time: 2017-10-02 15:54:12 Language: Python3 Status: READY Score: 100

Feedback

 group verdict score #1 ACCEPTED 10 #2 ACCEPTED 10 #3 ACCEPTED 10 #4 ACCEPTED 10 #5 ACCEPTED 10 #6 ACCEPTED 10 #7 ACCEPTED 10 #8 ACCEPTED 10 #9 ACCEPTED 10 #10 ACCEPTED 10

Test results

 test verdict time (s) group #1 ACCEPTED 0.10 / 1.00 1 details #2 ACCEPTED 0.08 / 1.00 2 details #3 ACCEPTED 0.10 / 1.00 3 details #4 ACCEPTED 0.07 / 1.00 4 details #5 ACCEPTED 0.07 / 1.00 5 details #6 ACCEPTED 0.07 / 1.00 6 details #7 ACCEPTED 0.06 / 1.00 7 details #8 ACCEPTED 0.10 / 1.00 8 details #9 ACCEPTED 0.12 / 1.00 9 details #10 ACCEPTED 0.19 / 1.00 10 details

Code

```#!/usr/bin/python3
import copy

def reverse_list(l):
ll = []
for i in l:
ll.append(reverse(i))
return ll

def reverse(s):
if s is '#':
return '.'
else:
return '#'

def new_frac(f, a, m):
if m < 1:
return f
t = copy.deepcopy(f)
for i in range(0, int(2**a)):
if i < 2**(a-1):
f[i].extend(t[i])
else:
z = t[i-2**(a-1)]
z.extend(reverse_list(z))
f.append(z)
if a < m:
return new_frac(f, a+1, m)
else:
return f

d = int(input())
ll = new_frac([['#']], 1, d-1)
for i in ll:
a = str()
for j in i:
a += j
print(a)
```

Test details

Test 1

Group: 1

Verdict: ACCEPTED

input
`1`
view   save

correct output
`#`
view   save

user output
`#`
view   save

Test 2

Group: 2

Verdict: ACCEPTED

input
`2`
view   save

correct output
```## #.```
view   save

user output
```## #.```
view   save

Test 3

Group: 3

Verdict: ACCEPTED

input
`3`
view   save

correct output
```#### #.#. ##.. #..#```
view   save

user output
```#### #.#. ##.. #..#```
view   save

Test 4

Group: 4

Verdict: ACCEPTED

input
`4`
view   save

correct output
```######## #.#.#.#. ##..##.. #..##..# ####.... #.#..#.# ##....## #..#.##.```
view   save

user output
```######## #.#.#.#. ##..##.. #..##..# ####.... #.#..#.# ##....## #..#.##.```
view   save

Test 5

Group: 5

Verdict: ACCEPTED

input
`5`
view   save

correct output
```################ #.#.#.#.#.#.#.#. ##..##..##..##.. #..##..##..##..# ####....####.... #.#..#.##.#..#.# ##....####....## #..#.##.#..#.##. ########........ #.#.#.#..#.#.#.# ##..##....##..## #..##..#.##..##. ####........#### #.#..#.#.#.##.#. ##....##..####.. #..#.##..##.#..#```
view   save

user output
```################ #.#.#.#.#.#.#.#. ##..##..##..##.. #..##..##..##..# ####....####.... #.#..#.##.#..#.# ##....####....## #..#.##.#..#.##. ########........ #.#.#.#..#.#.#.# ##..##....##..## #..##..#.##..##. ####........#### #.#..#.#.#.##.#. ##....##..####.. #..#.##..##.#..#```
view   save

Test 6

Group: 6

Verdict: ACCEPTED

input
`6`
view   save

correct output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.... ##..##..##..##..##..##..##..##... #..##..##..##..##..##..##..##.... ####....####....####....####..... #.#..#.##.#..#.##.#..#.##.#..#... ##....####....####....####....... #..#.##.#..#.##.#..#.##.#..#.#... ########........########......... #.#.#.#..#.#.#.##.#.#.#..#.#.#... ##..##....##..####..##....##..... #..##..#.##..##.#..##..#.##..#... ####........########........##... #.#..#.#.#.##.#.#.#..#.#.#.##.... ##....##..####..##....##..####... #..#.##..##.#..##..#.##..##.#.... ################................. #.#.#.#.#.#.#.#..#.#.#.#.#.#.#... ##..##..##..##....##..##..##..... #..##..##..##..#.##..##..##..#... ...```
view   save

user output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.... ##..##..##..##..##..##..##..##... #..##..##..##..##..##..##..##.... ####....####....####....####..... #.#..#.##.#..#.##.#..#.##.#..#... ##....####....####....####....... #..#.##.#..#.##.#..#.##.#..#.#... ########........########......... #.#.#.#..#.#.#.##.#.#.#..#.#.#... ##..##....##..####..##....##..... #..##..#.##..##.#..##..#.##..#... ####........########........##... #.#..#.#.#.##.#.#.#..#.#.#.##.... ##....##..####..##....##..####... #..#.##..##.#..##..#.##..##.#.... ################................. #.#.#.#.#.#.#.#..#.#.#.#.#.#.#... ##..##..##..##....##..##..##..... #..##..##..##..#.##..##..##..#... ...```
view   save

Test 7

Group: 7

Verdict: ACCEPTED

input
`7`
view   save

correct output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.... ##..##..##..##..##..##..##..##... #..##..##..##..##..##..##..##.... ####....####....####....####..... #.#..#.##.#..#.##.#..#.##.#..#... ##....####....####....####....... #..#.##.#..#.##.#..#.##.#..#.#... ########........########......... #.#.#.#..#.#.#.##.#.#.#..#.#.#... ##..##....##..####..##....##..... #..##..#.##..##.#..##..#.##..#... ####........########........##... #.#..#.#.#.##.#.#.#..#.#.#.##.... ##....##..####..##....##..####... #..#.##..##.#..##..#.##..```
view   save

user output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.... ##..##..##..##..##..##..##..##... #..##..##..##..##..##..##..##.... ####....####....####....####..... #.#..#.##.#..#.##.#..#.##.#..#... ##....####....####....####....... #..#.##.#..#.##.#..#.##.#..#.#... ########........########......... #.#.#.#..#.#.#.##.#.#.#..#.#.#... ##..##....##..####..##....##..... #..##..#.##..##.#..##..#.##..#... ####........########........##... #.#..#.#.#.##.#.#.#..#.#.#.##.... ##....##..####..##....##..####... #..#.##..##.#..##..#.##..```
view   save

Test 8

Group: 8

Verdict: ACCEPTED

input
`8`
view   save

correct output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.... ##..##..##..##..##..##..##..##... #..##..##..##..##..##..##..##.... ####....####....####....####..... #.#..#.##.#..#.##.#..#.##.#..#... ##....####....####....####....... #..#.##.#..#.##.#..#.##.#..#.#...```
view   save

user output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.... ##..##..##..##..##..##..##..##... #..##..##..##..##..##..##..##.... ####....####....####....####..... #.#..#.##.#..#.##.#..#.##.#..#... ##....####....####....####....... #..#.##.#..#.##.#..#.##.#..#.#...```
view   save

Test 9

Group: 9

Verdict: ACCEPTED

input
`9`
view   save

correct output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.... ##..##..##..##..##..##..##..##... #..##..##..##..##..##..##..##....```
view   save

user output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#.... ##..##..##..##..##..##..##..##... #..##..##..##..##..##..##..##....```
view   save

Test 10

Group: 10

Verdict: ACCEPTED

input
`10`
view   save

correct output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#....```
view   save

user output
```##############################... #.#.#.#.#.#.#.#.#.#.#.#.#.#.#....```
view   save