본문 바로가기

python-algorithm1422

[백준] 17838 1 2 3 4 5 6 7 for _ in range(int(input())): s=input() if len(s)==7: if s[0] == s[1] and s[1] !=s[2] and s[2]==s[3] and s[3]!=s[4] and s[4]!=s[5] and s[5]==s[6] : print(1) else: print(0) else: print(0) Colored by Color Scripter cs 2021. 1. 19.
[백준] 17826 1 2 3 4 5 6 7 8 9 10 tmp= (list(map(int, input().split()))) ans=tmp.index(int(input()))+1 if ans 2021. 1. 19.
[백준] 17608 1 2 3 4 5 6 7 8 9 10 import sys n=int(sys.stdin.readline()) tmp=[] for _ in range(n): tmp.append(int(sys.stdin.readline())) mymax=tmp[n-1] cnt=1 for i in range(n): if mymax 2021. 1. 19.
[백준] 17502 1 2 3 4 5 6 7 8 n=int(input()) s=list(input()) for i in range(n): if s[i].isalpha(): s[-1-i]=s[i] for i in range(n): if s[i]=='?' : s[i]='a' print(''.join(s)) cs 2021. 1. 19.
[백준] 17389 1 2 3 4 5 6 7 8 n=int(input()) ans=0 cnt=0 s=input() for i in range( n): if s[i]=='X' : cnt=0 else: ans+=i+1+cnt ; cnt+=1 print(ans) cs 2021. 1. 18.
[백준] 17350 1 2 3 4 5 tmp=[] for _ in range(int(input())): tmp.append(input()) if "anj" in tmp: print("뭐야;") else: print("뭐야?") cs 2021. 1. 18.
[백준] 17263 1 2 3 n=int(input()) tmp=sorted (list(map(int,input().split()))) print(tmp[n-1]) cs 2021. 1. 18.
[백준] 17249 1 2 a,b=input().split("(^0^)") print(a.count('@'),b.count("@")) cs 2021. 1. 18.
[백준] 17206 1 2 3 4 5 6 7 8 9 10 11 12 13 def sum3(n): n//=3 return int (n*(2*3+(n-1)*3)/2) def sum7(n): n//=7 return int (n*(2*7+(n-1)*7)/2) def sum21(n): n//=21 return int (n*(2*21+(n-1)*21)/2) n=int(input()) tmp=list(map(int,input().split())) for i in tmp: print(sum3(i)+sum7(i)-sum21(i) ) cs 2021. 1. 18.
[백준] 17201 123456n=int(input())s=input()cnt=0for i in range(len(s)-1): if s[i]==s[i+1]:cnt=1;print("No");exit()if cnt==0: print("Yes")cs 2021. 1. 18.
[백준] 17173 1 2 3 4 5 6 7 n,m=map(int,input().split()) ki=list(map(int,input().split())) tmp=[] for i in ki: for j in range(i,n+1): if j%i ==0:tmp.append(j) print(sum(set(tmp))) cs 2021. 1. 18.
[백준] 16968 1 2 3 4 5 6 7 8 9 10 11 s=input() if s[0]=='d': ans=10 if s[0]=='c' : ans=26 for i in range(1, len(s)) : if s[i] == 'd' : if s[i-1]==s[i]: ans*=9 else: ans*=10 elif s[i] == 'c' : if s[i - 1] == s[i]: ans *= 25 else: ans*=26 print(ans) cs 2021. 1. 18.