Problem | Verdict | Lang | Time | Best | Rank | Submit Time |
---|---|---|---|---|---|---|
| discuss10878 - | Accepted | Python | 0.180 | 0.000 | 5615 | 1 mins ago |
Suggest:
- In the problems decode, i think we should make doing step:
1/ Look overview and get information easy know like
+ input we have 8 char / line -> now we know need use bit
+ number of line = nuimber of char in string -> now we know every line is a present a char of output
2/ Thinking top down problem
+ A -> 65 -> 01000001 -> |_o___.__o|
_ = input()
while True:
s = input()
if s == '___________':
break
k = 0
n = 0
for i in range(len(s)-1, 0, -1):
if s[i] == 'o':
n += 1 << k
k += 1
if s[i] == ' ':
k += 1
print(chr(n), end='')
No comments:
Post a Comment