반응형
문제 링크
https://www.acmicpc.net/problem/11720
문제
코드
N = int(input())
num = input()
result = 0
for i in range(N):
result += int(num[i])
print(result)
반응형
https://www.acmicpc.net/problem/11720
N = int(input())
num = input()
result = 0
for i in range(N):
result += int(num[i])
print(result)
https://www.acmicpc.net/problem/9086
T = int(input())
for i in range(T):
str = input()
print(str[0]+str[-1])
[백준 2743] [Python] 단어 길이 재기 (0) | 2024.04.10 |
---|---|
[백준 27866] [Python] (0) | 2024.04.10 |
[백준 1546] [Python] 평균 (0) | 2024.04.10 |
[백준 10811] [Python] 바구니 뒤집기 (0) | 2024.04.10 |
[백준 3052] [Python] 나머지 (0) | 2024.04.10 |
[백준 9086] [Python] 문자열 (0) | 2024.04.10 |
---|---|
[백준 27866] [Python] (0) | 2024.04.10 |
[백준 1546] [Python] 평균 (0) | 2024.04.10 |
[백준 10811] [Python] 바구니 뒤집기 (0) | 2024.04.10 |
[백준 3052] [Python] 나머지 (0) | 2024.04.10 |
[백준 9086] [Python] 문자열 (0) | 2024.04.10 |
---|---|
[백준 2743] [Python] 단어 길이 재기 (0) | 2024.04.10 |
[백준 1546] [Python] 평균 (0) | 2024.04.10 |
[백준 10811] [Python] 바구니 뒤집기 (0) | 2024.04.10 |
[백준 3052] [Python] 나머지 (0) | 2024.04.10 |
https://www.acmicpc.net/problem/1546
N = int(input())
scores = list(map(int, input().split()))
M = max(scores)
for i in range(N):
scores[i] = scores[i]/M*100
print(sum(scores)/N)
[백준 2743] [Python] 단어 길이 재기 (0) | 2024.04.10 |
---|---|
[백준 27866] [Python] (0) | 2024.04.10 |
[백준 10811] [Python] 바구니 뒤집기 (0) | 2024.04.10 |
[백준 3052] [Python] 나머지 (0) | 2024.04.10 |
[백준 5597] [Python] 과제 안 내신 분..? (0) | 2024.04.10 |
https://www.acmicpc.net/problem/10811
N, M = map(int, input().split())
# 바구니에 번호 부여
basket = [n for n in range(1, N + 1)]
for _ in range(M):
i, j = map(int , input().split())
#뒤바꾸기 위해 temp에 보관
temp = basket[i - 1:j]
temp.reverse()
basket[i -1:j] = temp
for i in range (N):
print(basket[i], end=" ")
[백준 27866] [Python] (0) | 2024.04.10 |
---|---|
[백준 1546] [Python] 평균 (0) | 2024.04.10 |
[백준 3052] [Python] 나머지 (0) | 2024.04.10 |
[백준 5597] [Python] 과제 안 내신 분..? (0) | 2024.04.10 |
[백준 10813] [Python] 공 바꾸기 (0) | 2024.04.10 |
https://www.acmicpc.net/problem/3052
num = []
for i in range(10):
p = int(input())
r = p % 42
num.append(r)
result = set(num)
print(len(result))
[백준 1546] [Python] 평균 (0) | 2024.04.10 |
---|---|
[백준 10811] [Python] 바구니 뒤집기 (0) | 2024.04.10 |
[백준 5597] [Python] 과제 안 내신 분..? (0) | 2024.04.10 |
[백준 10813] [Python] 공 바꾸기 (0) | 2024.04.10 |
[백준 10810] [Python] 공 넣기 (0) | 2024.04.10 |
https://www.acmicpc.net/problem/5597
# 1에서 30까지 배열 생성
stu = [i for i in range(1, 31)]
# for loop로 받은 학번은 remove로 배열에서 제거
for i in range(28):
asg = int(input())
stu.remove(asg)
print(min(stu))
print(max(stu))
[백준 10811] [Python] 바구니 뒤집기 (0) | 2024.04.10 |
---|---|
[백준 3052] [Python] 나머지 (0) | 2024.04.10 |
[백준 10813] [Python] 공 바꾸기 (0) | 2024.04.10 |
[백준 10810] [Python] 공 넣기 (0) | 2024.04.10 |
[백준 2562] [Python] 최댓값 (0) | 2024.04.10 |
https://www.acmicpc.net/problem/10813
N, M = map(int, input().split())
# list 선언 후 각 번호에 해당되는 공 넣기
basket = [i for i in range(1, N + 1)]
temp = 0
for i in range(M):
i, j = map(int, input().split())
# 교환 시작
temp = basket[i - 1]
basket[i - 1] = basket[j - 1]
basket[j - 1] = temp
# 교환 끝
for i in range(N):
print(basket[i], end=' ')
[백준 3052] [Python] 나머지 (0) | 2024.04.10 |
---|---|
[백준 5597] [Python] 과제 안 내신 분..? (0) | 2024.04.10 |
[백준 10810] [Python] 공 넣기 (0) | 2024.04.10 |
[백준 2562] [Python] 최댓값 (0) | 2024.04.10 |
[백준 10818] [Python] 최소, 최대 (0) | 2024.04.10 |