20250604 baekjoon python
This commit is contained in:
parent
7f7d94d3f1
commit
0913637881
21
code_study/Baekjoon/python/1316.py
Normal file
21
code_study/Baekjoon/python/1316.py
Normal file
@ -0,0 +1,21 @@
|
||||
n = int(input())
|
||||
cnt = 0
|
||||
|
||||
for _ in range(n):
|
||||
chk = set()
|
||||
s = input()
|
||||
prev = None
|
||||
flag = True
|
||||
|
||||
for ch in s:
|
||||
if ch != prev :
|
||||
if ch in chk:
|
||||
flag = False
|
||||
break
|
||||
if prev is not None:
|
||||
chk.add(prev)
|
||||
prev = ch
|
||||
|
||||
if flag : cnt+=1
|
||||
|
||||
print(cnt)
|
||||
11
code_study/Baekjoon/python/25206.py
Normal file
11
code_study/Baekjoon/python/25206.py
Normal file
@ -0,0 +1,11 @@
|
||||
grade ={
|
||||
"A+" : 4.5, "A0" : 4.0,
|
||||
"B+" : 3.5, "B0" : 3.0,
|
||||
"C+" : 2.5, "C0" : 2.0,
|
||||
"D+" : 1.5, "D0" : 1.0,
|
||||
"F" : 0.0
|
||||
}
|
||||
line = [input().split() for _ in range(20)]
|
||||
credit = sum(float(line[i][1]) for i in range(20) if line[i][2] != 'P')
|
||||
rate = sum(float(line[i][1])*grade[line[i][2]] for i in range(20) if line[i][2] != 'P')
|
||||
print(round(rate/credit,6))
|
||||
5
code_study/Baekjoon/python/2941.py
Normal file
5
code_study/Baekjoon/python/2941.py
Normal file
@ -0,0 +1,5 @@
|
||||
alphabet = ["c=","c-","dz=","d-","lj","nj","s=","z="]
|
||||
s = input()
|
||||
for c in alphabet:
|
||||
s = s.replace(c,'!')
|
||||
print(len(s))
|
||||
Loading…
x
Reference in New Issue
Block a user