QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#73219 | #2942. 7 Segments You Say? | qdd# | WA | 12ms | 8012kb | Python3 | 2.7kb | 2023-01-23 06:21:52 | 2023-01-23 06:21:54 |
Judging History
answer
from math import ceil
s, allinput = input().split()
s = int(s)
if len(allinput) % 7 != 0:
allinput = "0" * (7 - len(allinput) % 7) + allinput
charspersymbol = s * 5
symbolsperline = (80 + s * 2) // charspersymbol
formatted = []
for i in range(len(allinput) // 7):
formatted.append(allinput[7 * i:7 * i + 7])
totallines = ceil(len(formatted) / symbolsperline)
for lines in range(totallines):
top = ""
for i in range(symbolsperline):
if i + lines * symbolsperline >= len(formatted):
break
if formatted[i + lines * symbolsperline][6] == "1":
top += "X" * 3 * s
else:
top += " " * 3 * s
if i < symbolsperline - 1:
top += " " * 2 * s
for i in range(s):
print(top)
vert1 = ""
for i in range(symbolsperline):
if i + lines * symbolsperline >= len(formatted):
break
if formatted[i + lines * symbolsperline][5] == "1":
vert1 += "X" * s
else:
vert1 += " " * s
vert1 += " " * s
if formatted[i + lines * symbolsperline][4] == "1":
vert1 += "X" * s
else:
vert1 += " " * s
if i < symbolsperline - 1:
vert1 += " " * 2 * s
for i in range(s * 2):
print(vert1)
mid = ""
for i in range(symbolsperline):
if i + lines * symbolsperline >= len(formatted):
break
if formatted[i + lines * symbolsperline][3] == "1":
mid += "X" * 3 * s
else:
mid += " " * 3 * s
if i < symbolsperline - 1:
mid += " " * 2 * s
for i in range(s):
print(mid)
vert2 = ""
for i in range(symbolsperline):
if i + lines * symbolsperline >= len(formatted):
break
if formatted[i + lines * symbolsperline][2] == "1":
vert2 += "X" * s
else:
vert2 += " " * s
vert2 += " " * s
if formatted[i + lines * symbolsperline][1] == "1":
vert2 += "X" * s
else:
vert2 += " " * s
if i < symbolsperline - 1:
vert2 += " " * 2 * s
for i in range(s * 2):
print(vert2)
bot = ""
for i in range(symbolsperline):
if i + lines * symbolsperline >= len(formatted):
break
if formatted[i + lines * symbolsperline][0] == "1":
bot += "X" * 3 * s
else:
bot += " " * 3 * s
if i < symbolsperline - 1:
bot += " " * 2 * s
for i in range(s):
print(bot)
if lines < totallines - 1:
for i in range(s):
print(" ")
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 12ms
memory: 8012kb
input:
1 110111111011
output:
XXX XXX X X X X XXX XXX X X X X X X XXX
result:
wrong answer 1st lines differ - expected: 'XXX XXX', found: 'XXX XXX '