Skip to content

Commit cf8316e

Browse files
authored
week1-숫자 정사각형, 캠핑 (#18)
* 수 정렬하기 3 * 수 정렬하기 3 * A+B * DNA * 숫자 정사각형 * 캠핑
1 parent 530af12 commit cf8316e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

hanjiwon1/week1/1051.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
n, m = map(int, input().split())
2+
rect = [input() for _ in range(n)]
3+
size = 1
4+
5+
for i in range(n):
6+
for j in range(m):
7+
for k in range(j + 1, m):
8+
if (rect[i][j] == rect[i][k] and k-j < n - i):
9+
if (rect[i+(k-j)][k] == rect[i][j] and rect[i+(k-j)][j] == rect[i][j]):
10+
if (size < k - j + 1):
11+
size = k - j + 1
12+
print(size**2)

hanjiwon1/week1/4796.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import sys
2+
3+
i = 0
4+
while True:
5+
i += 1
6+
l, p, v = map(int, sys.stdin.readline().split())
7+
if (l == 0 and p == 0 and v == 0):
8+
break
9+
d = (v // p) * l
10+
d += (v % p) if l > (v % p) else l
11+
print(f'Case {i}: {d}')

0 commit comments

Comments
 (0)