목록알고리즘 (2)
yeonseong
문제https://www.acmicpc.net/problem/13412풀이# https://www.acmicpc.net/problem/13412import sysinput = sys.stdin.readlinet = int(input())def gcd(a, b): while b > 0: a, b = b, a % b return adef count_disjoint_pair(n): cnt = 1 for i in range(2, int(n ** 0.5) + 1): if n % i == 0 and gcd(i, n // i) == 1: cnt += 1 return cntfor _ in range(t): n = int(input()) print(count_disjoint_pair..
문제링크https://www.acmicpc.net/problem/14500정답import sysinput = sys.stdin.readlinen, m = map(int, input().split())info = []res = 0def count_case(shape): cnt = 0 for e in shape: y, x = e if y = n or x = m: return 0 cnt += info[y][x] return cntdef max_count(i, j): # - block case_1 = count_case([(i, j), (i+1, j), (i+2, j), (i+3, j)]) case_2 = count_cas..