본문 바로가기

백준1064

백준 10173 니모를 찾아서 1 2 3 4 5 6 7 ㅇwhile 1: s=input() if s=='EOI': break else: s=s.lower() if 'nemo' in s:print("Found") else: print("Missing") cs 2021. 12. 2.
백준 3049 다각형의 대각선 1 2 3 4 import math n=int(input()) if n 2021. 11. 30.
백준 3047 ABC 1 2 3 4 5 6 7 8 9 tmp=list(map(int,input().split())) tmp=sorted(tmp) ans=[] s=input() for i in s: if i=='A': ans.append(tmp[0]) if i == 'B': ans.append(tmp[1]) if i == 'C': ans.append(tmp[2]) print(*ans) cs 2021. 11. 30.
백준 2998 8진수 1 2 3 4 5 6 7 8 9 10 n=str(input()) binary=0 for i in range(len(n)): binary+=pow(2,len(n)-1-i)*int(n[i]) octal="" while binary>0: octal+=str(binary%8) binary=binary//8 octal=octal[::-1] print(octal) cs 2021. 11. 30.
백준 2592 대표값 1 2 3 4 5 6 7 8 9 10 from collections import Counter tmp=[] for i in range(10): tmp.append(int(input())) print(sum(tmp)//10) cnt=Counter(tmp) print(cnt.most_common(1)[0][0]) cs 2021. 11. 30.
백준 20953 고고학자 예린 1 2 3 4 5 import sys n=int(sys.stdin.readline()) for i in range(n): a,b=map(int,sys.stdin.readline().split()) print((a+b)*(a+b)*(a+b-1)//2) cs 스탠다드 인풋 안쓰고 input()쓰시면 통과 안될꺼에요~ 2021. 11. 30.
백준 23756 노브 돌리기 1 2 3 4 5 6 7 8 n=int(input()) start=int(input()) ans=0 for i in range(n): go=int(input()) ans+=min(abs(start-go),360-start+go,start+360-go) start=go print(ans) Colored by Color Scripter cs 1.시작점에서 목적지 까지 바로가는방법 2. 오른쪽으로 한바퀴 감아서 목적지 까지 가는법. 3. 왼쪽으로 한바퀴 감아서 목적지 까지 가는법. 이 3가지 방법중에 가장 작은 각도로 이동하는 방법으로 가는 내용을 구현 2021. 11. 30.
백준 23320 홍익 절대평가 1 2 3 4 5 6 7 n=int(input()) scores=list(map(int,input().split())) x,y=map(int,input().split()) absolute=0 for i in scores: if i>=y: absolute+=1 print((n*x//100),absolute) cs 2021. 11. 30.
백준 23303 이 문제는 D2 입니다. 1 2 3 s=input() if 'd2' in s or 'D2' in s:print('D2') else: print('unrated') cs 2021. 11. 30.
백준 23080 스키테일 암호 1 2 3 4 5 6 n=int(input()) s=input() ans='' for i in range(0,len(s),n): ans+=s[i] print(ans) cs 2021. 11. 30.
백준 23027 1번부터 문제의 상태가…? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 s=input() n=len(s) tmpA='BCDF' tmpB='CDF' tmpC='DF' if 'A' in s: for i in s: if i in tmpA: s=s.replace(i,'A') elif 'B' in s: for i in s: if i in tmpB: s=s.replace(i,'B') elif 'C' in s: for i in s: if i in tmpC: s=s.replace(i,'C') else: s='A'*n print(s) cs 2021. 11. 30.
백준 22966 가장 쉬운 문제를 찾는 문제 1 2 3 4 5 6 n=int(input()) tmp=[] for i in range(n): tmp.append(input().split()) tmp=sorted(tmp,key= lambda x:x[1]) print(tmp[0][0]) cs 2021. 11. 30.