[백준] 10156, 2476, 2754, 7567, 5063, 10102, 10886 (파이썬)

Colacan·2022년 1월 26일
1

[백준]

목록 보기
10/43

백준의 Python 배우기(1~50)문제집의 내용이 거의 끝나간다. 예상한 것보다 상당히 빠르게 잘 풀렸다. 난이도를 높일 필요성이 있을 것 같다.

백준 10156번 과자

K,N,M = map(int,input().split())
if K*N-M >=0:
    print(K*N-M)
else:
    print(0)

백준 2476번 주사위 게임

N = int(input())
count = list()
for i in range(N):
    A,B,C = map(int,input().split())
    if A==B and B==C:
        count.append(10000+A*1000)
    elif A==B and B!=C:
        count.append(1000+A*100)
    elif A==C and B!=C:
        count.append(1000+A*100)
    elif B==C and A!=C:
        count.append(1000+B*100)
    else:
        count.append(max(A,B,C)*100)
print(max(count))

백준 2754번 학점계산

word = input()
if word == 'A+':
    print(4.3)
elif word =='A0':
    print(4.0)
elif word =='A-':
    print(3.7)
elif word =='B+':
    print(3.3)
elif word =='B0':
    print(3.0)
elif word =='B-':
    print(2.7)
elif word =='C+':
    print(2.3)
elif word =='C0':
    print(2.0)
elif word =='C-':
    print(1.7)
elif word =='D+':
    print(1.3)
elif word =='D0':
    print(1.0)
elif word =='D-':
    print(0.7)
elif word =='F':
    print(0.0)

백준 7567번 그릇

plate = input() + " "
count = 10
for i in range(len(plate)-1):
    if plate[i] == plate[i+1]:
        count += 5
    else:
        count += 10
print(count-10)

백준 5063번 TGN

N = int(input())
for i in range(N):
    r,e,c = map(int,input().split())
    if r<e-c:
        print('advertise')
    elif r==e-c:
        print('does not matter')
    elif r>e-c:
        print('do not advertise')

백준 10102번 개표

V = int(input())
num = input()
A_count = 0
B_count = 0
for i in num:
    if i == 'A' :
        A_count +=1
    elif i == 'B':
        B_count +=1
if A_count>B_count:
    print('A')
elif A_count<B_count:
    print('B')
elif A_count==B_count:
    print('Tie')

백준 10886번 0 = not cute / 1 = cute

N = int(input())
count_cute = 0
count_nocute = 0
for i in range(N):
    cute = int(input())
    if cute==1:
        count_cute +=1
    elif cute==0:
        count_nocute +=1
if count_cute>count_nocute:
    print('Junhee is cute!')
elif count_cute<count_nocute:
    print('Junhee is not cute!')
profile
For DE, DA / There is no royal road to learning

0개의 댓글