Daily AtCoder # 39 in Python

Introduction

Last time I will write today's story. I could only solve A and B. I can't beat sleep

A problem

ABC069-A

** Thoughts ** Just $ (n-1) * (m-1) $

n, m = map(int,input().split())

print((n-1)*(m-1))

B problem

ABC107-B

** Thoughts ** I did it recently so I was able to write it smoothly. Examine vertically and horizontally.

h, w = map(int,input().split())
a = [list(input()) for _ in range(h)]

yoko = []
for i in range(h):
    seta = set(a[i])
    if '#' in seta:
        yoko.append(a[i])

h = len(yoko)
w = len(yoko[0])
for i in range(w):
    tate = []
    for j in range(h):
        tate.append(yoko[j][i])
    settate = set(tate)
    if '#'not in settate:
        for j in range(h):
            yoko[j][i] = ''

ans = ''
for i in range(h):
    c = ''.join(yoko[i])
    ans += c
    if i != h-1:
        ans += '\n'
print(ans)

C problem

ABC089-C I didn't know how to calculate the combination

D problem

ABC075-C It seems that it can be solved by dropping the edges and dfs, but it cannot be implemented.

Summary

If this is a production, the rate will drop, so I will review it so that I can solve it. Recently, I'm working hard because sometimes I can't write even if I try to solve it with dfs. See you again, good night

Recommended Posts

Daily AtCoder # 36 in Python
Daily AtCoder # 2 in Python
Daily AtCoder # 32 in Python
Daily AtCoder # 6 in Python
Daily AtCoder # 53 in Python
Daily AtCoder # 33 in Python
Daily AtCoder # 7 in Python
Daily AtCoder # 37 in Python
Daily AtCoder # 8 in Python
Daily AtCoder # 21 in Python
Daily AtCoder # 38 in Python
Daily AtCoder # 11 in Python
Daily AtCoder # 15 in Python
Daily AtCoder # 47 in Python
Daily AtCoder # 13 in Python
Daily AtCoder # 45 in Python
Daily AtCoder # 30 in Python
Daily AtCoder # 10 in Python
Daily AtCoder # 28 in Python
Daily AtCoder # 39 in Python
Daily AtCoder # 20 in Python
Daily AtCoder # 19 in Python
Daily AtCoder # 52 in Python
Daily AtCoder # 3 in Python
Daily AtCoder # 14 in Python
Daily AtCoder # 50 in Python
Daily AtCoder # 26 in Python
Daily AtCoder # 4 in Python
Daily AtCoder # 43 in Python
Daily AtCoder # 29 in Python
Daily AtCoder # 22 in Python
Daily AtCoder # 49 in Python
Daily AtCoder # 27 in Python
Daily AtCoder # 1 in Python
Daily AtCoder # 25 in Python
Daily AtCoder # 16 in Python
Daily AtCoder # 12 in Python
Daily AtCoder # 48 in Python
Daily AtCoder # 23 in Python
Daily AtCoder # 34 in Python
Daily AtCoder # 51 in Python
Daily AtCoder # 31 in Python
Daily AtCoder # 46 in Python
Daily AtCoder # 35 in Python
Daily AtCoder # 9 in Python
Daily AtCoder # 44 in Python
Daily AtCoder # 41 in Python
Atcoder ABC164 A-C in Python
atCoder 173 Python
Python Input Note in AtCoder
Atcoder ABC167 A-D in Python
Atcoder ABC165 A-D in Python
Atcoder ABC166 A-E in Python
Atcoder ABC169 A-E in Python
AtCoder ABC177 A-D in python
Solve Atcoder ABC169 A-D in Python
[Python] Basic knowledge used in AtCoder
Quadtree in Python --2
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda