20250523 baekjoon python

This commit is contained in:
songyc macbook 2025-05-23 19:13:01 +09:00
parent 15b126ade5
commit a1367470a2
11 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,5 @@
arr = [-1]*26
s = input()
for i in range(len(s)):
if (arr[ord(s[i])-97] == -1) : arr[ord(s[i])-97] = i
print(*arr)

View File

@ -0,0 +1 @@
print(len(input().split()))

View File

@ -0,0 +1 @@
print(ord(input()))

View File

@ -0,0 +1,2 @@
import sys
print(sys.stdin.read())

View File

@ -0,0 +1,2 @@
n = input()
print(sum(int(s) for s in input()))

View File

@ -0,0 +1,5 @@
for _ in range(int(input())):
r, s = input().split()
for i in s:
print(i*int(r),end="")
print()

View File

@ -0,0 +1 @@
print(len(input()))

View File

@ -0,0 +1,3 @@
s = input()
i = input()
print(s[int(i)-1])

View File

@ -0,0 +1,2 @@
a, b = input().split()
print(max(int(a[::-1]),int(b[::-1])))

View File

@ -0,0 +1,5 @@
dial = [3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,8,9,9,9,10,10,10,10]
t = 0
for s in input():
t+=dial[ord(s)-65]
print(t)

View File

@ -0,0 +1,3 @@
for i in range(int(input())):
s = input()
print(s[0]+s[-1])