본문 바로가기

프로그래밍/Baekjoon

(52)
(파이썬) 백준 알고리즘 1110번 문제풀이 (Python) 1234567891011121314151617181920212223n = input() if int(n)
(파이썬) 백준 알고리즘 4344번 문제 풀이 (Python) 123456789101112131415161718C = int(input())avg = []for i in range(C): N = list(map(int, input().split())) sum = 0 for j in range(N[0]): sum += N[j+1] cnt = 0 for j in range(N[0]): if N[j+1] > sum/N[0]: cnt += 1 avg.append(cnt/N[0]*100) N.clear() for i in range(C): print('%.3f%%' %avg[i])cs키워드 (Keyword)append 리스트에 맨 마지막에 요소 추가참조https://wikidocs.net/book/1 (점프 투 파이썬-WikiDocs)문제 출처ht..
(파이썬) 백준 알고리즘 1546번 문제 풀이 (Python)1234567891011121314151617n = int(input()) score = list(map(float, input().split())) max = 0for i in range(n): if score[i] > max: max = score[i] for i in range(n): score[i] = score[i]/max*100 sum = 0for i in range(n): sum += score[i] print(sum/n)cs문제 출처https://www.acmicpc.net/problem/1546
(파이썬) 백준 알고리즘 10871번 문제풀이 (Python) 123456N, X = map(int, input().split())A = list(map(int,input().split())) for i in range(N): if A[i]
(파이썬) 백준 알고리즘 10817번 문제풀이 (Python)12345N = list(map(int, input().split())) N.sort(reverse = True) print(N[1])cs키워드 (Keyword)sort리스트를 정렬 (새로운 리스트 리턴 x)디폴트는 오름차순 정렬해주며 내림차순 정렬시 sort(reverse=True)로 사용한다.sorted리스트를 정렬 (새로운 리스트 리턴 O)디폴트는 오름차순 정렬해주며 내림차순 정렬시 sorted(list,reverse=True)로 사용한다. 참조장삼용, 초보자를 위한 파이썬 200제, 정보문화사(2017) 문제 출처https://www.acmicpc.net/problem/10817
(파이썬) 백준 알고리즘 9498번 문제 풀이 (Python)123456789101112score = int(input()) if score >= 90 and score = 80 and score = 70 and score = 60 and score
(파이썬) 백준 알고리즘 11721번 문제풀이 (Python)1234a = input() for i in range(0,len(a),10): print(a[i:i+10])cs 문제 출처https://www.acmicpc.net/problem/11721
(파이썬) 백준 알고리즘 11720번 문제풀이 (Python)12345678n = int(input())a = input() sum = 0for i in range(n): sum += int(a[i]) print(sum)cs 문제 출처https://www.acmicpc.net/problem/11720