본문 바로가기
SMALL

삼성아카데미14

[SW Expert Academy] 초심자의 회문 검사 *문제의 저작권은 SW Expert에 있습니다. 문제 링크 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PyTLqAf4DFAUq&categoryId=AV5PyTLqAf4DFAUq&categoryType=CODE T = int(input()) for test_case in range(1, T + 1): test = list(map(str, input().split())) test = ('').join(test) a = 0 for i in range(0,int(len(test)/2)) : a = (lambda x : 1 if x[i] == x[len(x)-1-i] else 0)(test) #if test[i.. 2021. 1. 21.
[SW Expert Academy] 파스칼의 삼각형 *문제의 저작권은 SW Expert에 있습니다. 문제 링크 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5P0-h6Ak4DFAUq&categoryId=AV5P0-h6Ak4DFAUq&categoryType=CODE version1. 파스칼의 삼각형 공식 사용 T = int(input()) def combination(n, r): c = int(math.factorial(n) / (math.factorial(r) * math.factorial(n - r))) return str(c) for test_case in range(1, T + 1): result = int(input()) a = [] print("#.. 2021. 1. 21.
[SW Expert Academy] 조교의 성적 매기기 *문제의 저작권은 SW Expert에 있습니다. 문제 링크 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PwGK6AcIDFAUq&categoryId=AV5PwGK6AcIDFAUq&categoryType=CODE T = int(input()) score = ["A+", "A0", "A-", "B+", "B0", "B-", "C+", "C0", "C-", "D0"] for test_case in range(1,T+1): N, K = map(int, input().split()) a = [] c = 0 for t_case in range(1, N + 1): test = list(map(int, input()... 2021. 1. 21.
[SW Expert Academy] 자릿수 더하기 *문제의 저작권은 SW Expert에 있습니다. 문제 링크 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QPRjqA10DFAUq&categoryId=AV5QPRjqA10DFAUq&categoryType=CODE T = int(input()) T1 = int(T/1000) T2 = int((T%1000)/100) T3 = int((T%100)/10) T4 = int(T%10) result = T1+T2+T3+T4 print(result) 2021. 1. 20.
[SW Expert Academy] 중간값 찾기 *문제의 저작권은 SW Expert에 있습니다. 문제 링크 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QPsXKA2UDFAUq&categoryId=AV5QPsXKA2UDFAUq&categoryType=CODE import statistics T = int(input()) result = list(map(int, input().split(" "))) #result.sort() #a = int(T/2) #print("{}".format(result[a])) print(statistics.median(result)) median함수를 사용하려면 statistics를 import해야 함. 사용 시 코드는 짧아.. 2021. 1. 20.
[SW Expert Academy] 최대수 구하기 *문제의 저작권은 SW Expert에 있습니다. 문제 링크 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5QQhbqA4QDFAUq&categoryId=AV5QQhbqA4QDFAUq&categoryType=CODE T = int(input()) for test_case in range(1, T + 1): result = list(map(int, input().split(" "))) result.sort(reverse=True) print("#{} {}".format(test_case,result[0])) 2021. 1. 20.
LIST