π2914 ν¬λ‘μν°μ μνλ²³
μ²μ λ± λ μκ°μ
μΌλ¨ μνλ²³μΌλ‘ μ λΆ λ³΄κ³ κΈμμλ₯Ό μΌ νμ
= - j
μ΄ μΈκ°μ§μ μμ λ¬Έμκ° μΌμ΄μ€μ ν΄λΉνλ©΄ κ°μ -1 ν΄μ£Όλ κ²!
λ§μμ¬.. λλν νμ΄μ¬.. -1λ μΈμ£Όλ€..? λ€μλ€μ..
λ΄νμ΄2 (μ€λ΅)
import sys
input = sys.stdin.readline
word = input().strip()
cnt = len(word)
for i in range(len(word)):
if i>0:
if word[i]=="-":
if word[i+1]=="c" or word[i-1]=="d":
cnt-=1
elif word[i]=="j":
if word[i-1]=="l" or word[i-1]=="n":
cnt-=1
elif word[i]=="=":
if word[i-1]=="c" or word[i-1]=="s":
cnt-=1
elif word[i-1]=="z":
cnt-=1
if i>1:
if word[i-2]=="d":
cnt-=1
print(cnt)
κ³λ¨μ ifλ¬Έμ΄ μμ±λμλ€.
μ¨μ testcaseμμ μκΈ΄ μ€λ΅μ΄μκ³ , κ·Έκ² μλμ΄λλκ° μλͺ»λλ€λ μκ°μ΄ λ€μλ€.
λ΄ νμ΄ 3
coratia=['c=','c-','dz=','d-','lj','nj','s=','z=']
word=input().strip()
for i in coratia:
word=word.replace(i,'?')
print(len(word))
μΈμμ..
replace?
μ μ΄μκ°μ λͺ»νμμ§? κ³Όκ±°μ λ λλ¨ν΄. λΉ λ₯΄κ³ μ½λ€.
π λλ‘λ μ¬κ³ μ μ νμ! λ΄κ° νλ νμ΄μ κ°νμ§ λ§κ³ μλ‘κ² μκ°ν΄λ³΄μ
π1427 μνΈμΈμ¬μ΄λ
μ λ ₯ λ²μκ° λ무 컀μ κ·Έλ₯ μ λ ¬λ‘ μλ κ²κ°μ λλμ΄μλ€.
import sys
input = sys.stdin.readline
rank = [0]*1000000000
num = input().strip()
for i in num:
rank[int(i)]+=1
for j in range(len(rank)-1,0,-1):
if rank[j]!=0:
print(j)
κ·Έλμ μ΄λ κ² μ§λ΄€λλ° λ§₯λΆμ΄ λ λΌκ°λ» νλ°..
λ΄νμ΄ 1
import sys
input = sys.stdin.readline
numLst=[]
num = input().strip()
ans=""
for i in num:
numLst.append(int(i))
numLst=sorted(numLst,reverse=True)
for i in numLst:
ans+=str(i)
print(ans)
ν΅κ³Ό!
μ΄μ§ λ κ°λ¨νκ² λ°κΎΌλ€λ©΄
λ΄ νμ΄2
import sys
input = sys.stdin.readline
numLst=[]
num = input().strip()
for i in num:
numLst.append(i)
numLst=sorted(numLst,reverse=True)
numLst = "".join(numLst)
print(numLst)
κ°κ³Όν μ : intνμΌλ‘ λ°κΎΈμ§ μμλ μ λ ¬λλ€
λ°°μ΄μ λ¬Έμλ‘ λ°κΏλ "".join(λ°°μ΄) ν΄μ£Όλ©΄ λλ€.
πκ°λ¨νκ±Έ μμ΄λ²λ¦¬λ λ©λ¦¬ λμκ°κ² λλ€.
λκΈ