본문 바로가기

python-algorithm1422

[백준] 1357 1 2 3 4 5 6 7 8 9 10 s=input() ans=0 for i in range(1,len(s)): tmp1,tmp2=s[:i],s[i:] cnt1=1 cnt2=1 for j in range(len(tmp1)): cnt1*=int(tmp1[j]) for j in range(len(tmp2)): cnt2*=int(tmp2[j]) if cnt1==cnt2: print("YES"); ans=1;break if ans==0:print("NO") cs 2021. 1. 20.
[백준] 1356 1 2 3 4 5 6 7 8 9 10 s=input() ans=0 for i in range(1,len(s)): tmp1,tmp2=s[:i],s[i:] cnt1=1 cnt2=1 for j in range(len(tmp1)): cnt1*=int(tmp1[j]) for j in range(len(tmp2)): cnt2*=int(tmp2[j]) if cnt1==cnt2: print("YES"); ans=1;break if ans==0:print("NO") cs 2021. 1. 20.
[백준] 1312 1 2 3 4 5 a,b,n=map(int, input().split()) a%=b for _ in range(n-1): a=(a*10)%b print((a*10)//b) cs 2021. 1. 20.
[백준] 1296 1 2 3 4 5 6 mn,cnt,name=input(),-1,"" for i in sorted([input() for _ in range(int(input()))]): l,o,v,e=mn.count('L')+i.count('L'),mn.count('O')+i.count('O'),+mn.count('V')+i.count('V'),mn.count('E')+i.count('E') cal= ((l+o)*(l+v)*(l+e)*(v+o)*(e+o)*(v+e))%100 if (cnt 2021. 1. 20.
[백준] 1259 1 2 3 4 5 6 while 1: s=input() if s=='0': break else: if s==s[::-1]: print('yes') else: print('no') cs 2021. 1. 20.
[백준] 1252 1 2 3 4 5 6 7 8 def btoD(n): n=str(n) ans=0 for i in range(len(n)): ans+=pow(2,len(n)-i-1)*int(n[i]) return(ans) a,b=map(int, input().split()) print( bin (btoD(a)+btoD(b)) [2:] ) cs 2021. 1. 20.
[백준] 1236 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import sys def guard(n, m): col = [0 for i in range(n)] row = [0 for i in range(m)] for i in range(n): guard_list = list(map(str, sys.stdin.readline().strip())) for j in range(m): if guard_list[j] == 'X': col[i] += 1 row[j] += 1 if col.count(0) > row.count(0): return col.count(0) else: return row.count(0) n, m = map(int, sys.stdin.readline().spl.. 2021. 1. 20.
[백준] 1032 1 2 3 4 5 6 7 8 9 n=int(input()) start=list(input()) ans='' for _ in range(n-1): s=list(input()) for i in range(len(s)) : if start[i]==s[i] : continue else: start[i]='?' print(''.join(start)) cs 2021. 1. 20.
[백준] 20528 1 2 3 4 5 6 7 n=int(input()) tmp=list(map(str, input().split())) ans=set() for i in range(n): ans.add(tmp[i][0]) if len(ans)==1 : print(1) else: print(0) cs 2021. 1. 20.
[백준] 20494 1 2 3 4 cnt=0 for _ in range(int(input())): cnt+=len(input()) print(cnt) cs 2021. 1. 20.
[백준] 20299 1 2 3 4 5 6 7 8 9 10 import sys n,k,l=map(int,sys.stdin.readline().split()) cnt=0 tmp=[] for _ in range(n): a,b,c=map(int, sys.stdin.readline().split()) if a>=l and b>=l and c>=l : if a+b+c>=k : cnt+=1; tmp.append(a); tmp.append(b); tmp.append(c) print(cnt) print(*tmp) Colored by Color Scripter cs 2021. 1. 20.
[백준] 20155 1 2 3 4 5 6 7 import sys n,m=map(int, sys.stdin.readline().split()) tmp=list(map(int, sys.stdin.readline().split())) ans=[0]*(m+1) for i in tmp: ans[i]+=1 print(max(ans)) Colored by Color Scripter cs 2021. 1. 20.