1차 제출. [ 10 / 10 ] PASS
어.. 금방 끝났다! 히히
T = int(input())
for tc in range(1, T+1):
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
if n > m:
long, short = a, b
else:
long, short = b, a
result = 0
for i in range(len(long)-len(short)+1):
temp = 0
for j in range(len(short)):
temp += long[i:i+len(short)][j]*short[j]
result = max(result, temp)
print("#{} {}".format(tc, result))
'CodingTest > SW Expert Academy' 카테고리의 다른 글
[ SW Expert Academy ] 1986. 지그재그 숫자 (0) | 2022.11.15 |
---|---|
[ SW Expert Academy ] 1961. 숫자 배열 회전 (0) | 2022.11.15 |
[ SW Expert Academy ] 1983. 조교의 성적 매기기 (0) | 2022.11.15 |
[ SW Expert Academy ] 1979. 어디에 단어가 들어갈 수 있을까 * 다시 풀기 * (0) | 2022.11.15 |
[ SW Expert Academy ] 1989. 초심자의 회문 검사 (0) | 2022.11.15 |