728x90
π λ°±μ€ 2490 - μ·λμ΄
β‘οΈ λμ νμ΄
μ·μ§λ€μ μνλ₯Ό λ³΄κ³ λ(A)
, κ°(B)
, κ±Έ(C)
, μ·(D)
, λͺ¨(E)
λ₯Ό νλ³νλ λ¬Έμ λ€. μ·μ§λ€μ ꡬμ±νλ κ°μ 0 λλ 1 μμ μ μ μλ€. νμ§λ§ μ·μ§λ€μ΄ μ£Όμ΄μ§ λ 0κ³Ό 1μ μμκ° λ€λ°λ μ μμμ μΈμ§νμ. λλ μ΄ 2κ°μ§ λ°©λ²μΌλ‘ νμλλ°
- μ£Όμ΄μ§λ κ°κ°μ μ€λ§λ€
ν©(sum)
μ κ΅¬ν΄ μΆλ ₯μ ꡬλΆνλ€. - 0κ³Ό 1μ κ°μλ₯Ό νμ
νλλ‘
count
ν¨μλ₯Ό μ¬μ©νλ€.
μ λ΅νμ μ λ°κ³ λ€λ₯Έ μ¬λμ μ½λλ₯Ό λ΄€λλ° 1λ²μ sum
μ μ
λ ₯μ λ°μ λ ν λ²μ μ μΈν΄μ€λ λκ³ , 2λ²μ count
λ 0κ³Ό 1 λ λ€ ν νμμμ΄ λ μ€μ νλλ§ ν΄μ€λ ꡬλΆμ΄ κ°λ₯νλ€.
# sum
yut = [list(map(int, input().split())) for _ in range(3)]
for i in yut:
if sum(i) == 3:
print('A')
elif sum(i) == 2:
print('B')
elif sum(i) == 1:
print('C')
elif not sum(i):
print('D')
elif sum(i) == 4:
print('E')
# count
yut = [list(map(int, input().split())) for _ in range(3)]
for i in yut:
if i.count(0) == 1 and i.count(1) == 3:
print('A')
elif i.count(0) == 2 and i.count(1) == 2:
print('B')
elif i.count(0) == 3 and i.count(1) == 1:
print('C')
elif i.count(0) == 4:
print('D')
elif i.count(1) == 4:
print('E')
# λ€λ₯Έ μ¬λμ μ½λ
# sum
yut = [sum(map(int, input().split())) for _ in range(3)]
for i in yut:
if i == 3:
print('A')
elif i == 2:
print('B')
elif i == 1:
print('C')
elif not i:
print('D')
elif i == 4:
print('E')
# count
yut = [list(map(int, input().split())) for _ in range(3)]
for i in yut:
if i.count(0) == 1:
print('A')
elif i.count(0) == 2:
print('B')
elif i.count(0) == 3:
print('C')
elif i.count(0) == 4:
print('D')
elif i.count(1) == 4:
print('E')
λ°μν
'Algorithm > λ°±μ€(BOJ)' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[ νμ΄μ¬(python) ] λ°±μ€ 20436 - ZOAC 3 (4) | 2021.06.01 |
---|---|
[ νμ΄μ¬(python) ] λ°±μ€ 1244 - μ€μμΉ μΌκ³ λκΈ° (4) | 2021.05.31 |
[ νμ΄μ¬(python) ] λ°±μ€ 3009 - λ€ λ²μ§Έ μ (0) | 2021.05.30 |
[ νμ΄μ¬(python) ] λ°±μ€ 1110 - νμ μΉΈ (0) | 2021.05.28 |
[ νμ΄μ¬(python) ] λ°±μ€ 2578 - λΉκ³ (0) | 2021.05.28 |
λκΈ