python-algorithm1422 [백준] 16944 1 2 3 4 5 6 7 8 9 10 11 12 specialString='!@#$%^&*()-+' n=int(input()) s=input() tmp=[1,1,1,1] for i in s: if ord(i)>=48 and ord(i)=65 and ord(i)=97 and ord(i)6 : print(sum(tmp)) else: print(sum(tmp)+ 6-n) cs 2021. 1. 18. [백준] 16676 1 2 3 4 5 6 7 n=input() mysize=len(n) tmp='' for _ in range(mysize): tmp+='1' if mysize==1 : print(1) elif int(n) >=int(tmp): print(mysize) else: print(mysize-1) cs 이 문제는 손으로 적어가면서.. 경우의 수를 생각해보면 풀 수 있으실겁니다. 구현하는게 어려운게 아니라 문제가 뭔지 정확히 이해하는게 어려워요 2021. 1. 18. [백준] 16674 1 2 3 4 5 6 7 8 9 tmp=[0]*10 s=input() for i in s: tmp[int(i)]+=1 if (sum(tmp[3:8])+tmp[9])>0: print(0) else: if tmp[0]>0 and tmp[1]>0 and tmp[2]>0 and tmp[8]>0 : if tmp[0]== tmp[1] ==tmp[2]==tmp[8]: print(8) else: print(2) else: print(1) Colored by Color Scripter cs 2021. 1. 18. [백준] 16515 1 2 3 4 5 import math cnt=0 for i in range (int(input())+1): cnt+=1/math.factorial(i) print(cnt) cs 2021. 1. 18. [백준] 16497 1 2 3 4 5 6 7 tmp=[0]*32 for _ in range(int(input())): a,b=map(int,input().split()) for i in range(a,b): tmp[i]+=1 if max(tmp)> int(input()): print(0) else: print(1) cs 2021. 1. 18. [백준] 16462 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 import math cnt=0 n=int(input()) for _ in range(n): tmp=input() if tmp=='100' : cnt+=100 else: tmpnew = '' for i in range(len(tmp)): if tmp[i] == '6' : tmpnew+='9' elif tmp[i] == '0' : tmpnew+='9' else: tmpnew+=tmp[i] cnt+=int(tmpnew) ans=cnt/n if ans- int(ans) >=0.5 : print(math.ceil(ans)) else: print(math.floor(ans)) cs 6이랑 0을 9로 바꾼다 이게 말은 쉬운데요 2021. 1. 18. [백준] 16396 1 2 3 4 5 6 tttmp=[0]*10001 for _ in range(int(input())): a,b=map(int,input().split()) for i in range(a,b): tmp[i]=1 print(sum(tmp)) cs 문제만 읽으면 바로 이해가 되기 힘든데 본문 밑에 힌트 보시면 조금 이해하시는데 도움이 될꺼에요 2021. 1. 18. [백준] 15969 1 2 3 n=int(input()) s=list(map(int, input().split())) print(max(s)-min(s)) cs 2021. 1. 15. [백준] 15829 1 2 3 4 5 6 7 n=int(input()) s=input() cnt=0 for i in range(n): cnt+=((ord (s[i])-96)*pow(31,i)) cnt%=1234567891 print(cnt) cs 2021. 1. 15. [백준] 15819 1 2 3 4 5 a,b=map(int, input().split()) tmp=[] for _ in range(a): tmp.append(input()) print((sorted(tmp))[b-1]) cs 2021. 1. 15. [백준] 15814 1 2 3 4 5 6 7 8 9 s=list(input()) for _ in range(int(input())): a,b=map(int, input().split()) tmp=s[a] s[a]=s[b] s[b]=tmp for i in range(len(s)): print(s[i],end='') Colored by Color Scripter cs 2021. 1. 15. [백준] 15813 1 2 3 4 5 cnt=0 n=int(input()) for i in input(): cnt+= ord (i)-64 print(cnt) cs 2021. 1. 15. 이전 1 ··· 87 88 89 90 91 92 93 ··· 119 다음