본문 바로가기

전체 글50

1961. 숫자 배열 회전 import copy t = int(input()) for i in range(t): lst = [] n = int(input()) for j in range(n): lst.append(list(map(int,input().split()))) ch_lst = copy.deepcopy(lst) ans = ['']*3 for h in range(3): for j in range(n): nh = 0 for k in range(n-1,-1,-1): ch_lst[j][nh] = lst[k][j] ans[h] = ans[h] + str(ch_lst[j][nh]) nh = nh + 1 lst =copy.deepcopy(ch_lst[:]) print('#%d' % (i+1)) for j in range(0,n*n,+n.. 2019. 9. 12.
1970. 쉬운 거스름돈 t = int(input()) for i in range(t): n = int(input()) lst = [0] * 8 lst[0] = int(n/50000) n = (n % 50000) lst[1] = int(n/10000) n = (n % 10000) lst[2] = int(n/5000) n = (n % 5000) lst[3] = int(n/1000) n = (n % 1000) lst[4] = int(n/500) n = (n % 500) lst[5] = int(n/100) n = (n % 100) lst[6] = int(n/50) n = (n % 50) lst[7] = int(n/10) n = (n % 10) print('#%d'%(i+1)) for j in range(8): if j == 7: pr.. 2019. 9. 10.
1976. 시각 덧셈 t = int(input()) for i in range(t): h1,m1,h2,m2 = map(int,input().split()) plus = 0 m = m1 + m2 h = h1 + h2 if m > 59: plus = 1 i m = m % 60 h = h + plus if h > 12: if h % 12 == 0: h = 12 else: h =h % 12 print('#%d'%(i+1),h,m) 2019. 9. 10.
1974. 스도쿠 검증 t = int(input()) for i in range(t): lst = [] ans = [0] * 10 for j in range(9): lst.append(list(map(int,input().split()))) for j in range(9): sum1 = 0 sum2 = 0 for k in range(9): sum1 = sum1 + lst[j][k] sum2 = sum2 + lst[k][j] if sum1 > 45 or sum2 > 45: ans[j] = 1 if sum1 2019. 9. 10.
1983. 조교의 성적 매기기 t = int(input()) for i in range(t): n,k = map(int,input().split()) score = [0]*n ans = 0 for j in range(n): lst = list(map(int,input().split())) score[j] = (lst[0]*0.35)+(lst[1]*0.45)+(lst[2]*0.2) if k - 1 == j: ans = score[j] score.sort() score.reverse() hak = ['A+','A0','A-','B+','B0','B-','C+','C0','C-','D0'] hak_idx = 0 for j in range(0,n,int(n/10)): for k in range(j,j+(int(n/10))): if ans =.. 2019. 9. 8.
1984. 중간 평균값 구하기 t = int(input()) for i in range(t): lst = list(map(int,input().split())) maxx = max(lst) minn = min(lst) hap = 0 for j in range(10): if maxx == lst[j] or minn == lst[j]: continue; else: hap = hap + lst[j] print('#%d'%(i+1),round((hap/8))) 2019. 9. 8.