Skip to content

Commit

Permalink
Merge pull request #67 from HYU-PS-STUDY/leGit-y
Browse files Browse the repository at this point in the history
[week-10] 11401, 16967
  • Loading branch information
clean2001 authored Mar 30, 2024
2 parents cc87df5 + b613ccf commit 15c1a51
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Empty file removed week10/leGit-y/.gitkeep
Empty file.
13 changes: 13 additions & 0 deletions week10/leGit-y/11401.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
N,K=map(int, input().split())
MOD = 1000000007
top,bottom = 1, 1

for i in range(K):
top *= N - i
top %= MOD
for i in range(1, K + 1):
bottom *= i
bottom %= MOD

bottom = pow(bottom, -1, MOD)
print((top * bottom) % MOD)
22 changes: 22 additions & 0 deletions week10/leGit-y/16967.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
H, W, X, Y = map(int, input().split())

B = [list(map(int, input().split())) for _ in range(H+X)]
A = [[0]*(W+Y) for _ in range(H+X)]

for i in range(X):
for j in range(W):
A[i][j] = B[i][j]

for i in range(X, H+X):
for j in range(Y):
A[i][j] = B[i][j]
for j in range(Y, W+Y):
A[i][j] = B[i][j] - A[i-X][j-Y]

for i in range(H):
for j in range(W):
print(A[i][j], end = ' ')
print()



0 comments on commit 15c1a51

Please sign in to comment.