-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
12-SeongHoonC #45
12-SeongHoonC #45
Conversation
if (checkPaper(x = x, y = y, n = n, paper = paper, target = 1) { blue++ }) return | ||
if (checkPaper(x = x, y = y, n = n, paper = paper, target = 0) { white++ }) return | ||
|
||
val divN = n / 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μ΄λ κ² n//2λΆλΆμ κ·Έλ₯ 보기 νΈνκ² λ§λ€ μ μλ€μ!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ³μλ₯Ό λ°λ‘ μ μ₯νμ§ μμλ μ»΄νμΌλ¬κ° μ΅μ νν΄μ μ¬λ¬λ² μ°μ°μ΄ μΌμ΄λμ§ μκ² μ§λ§..κ°μΈμ μΌλ‘ λ€λ₯Έ μ¬λμ΄ μ΄ν΄νκΈ° μ½λλ‘ μ΄λ¦ μ§μ΄μ£Όλ νΈμ λλΉ!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
white_color = 0
blue_color = 0
def divide(start_x, end_x, start_y, end_y) :
global white_color, blue_color
checking_color = paper[start_x][start_y]
sw=0
for index_x in range(start_x, end_x):
for index_y in range(start_y, end_y):
if paper[index_x][index_y] != checking_color :
sw=1
break
if sw==1 : break
if sw==0 :
if checking_color == 1 :
blue_color = blue_color +1
else :
white_color = white_color + 1
else :
divide(start_x, int((start_x + end_x)/2), start_y, int((start_y+end_y)/2))
divide(start_x, int((start_x+end_x)/2), int((start_y+end_y)/2), end_y)
divide(int((start_x+end_x)/2), end_x, start_y, int((start_y+ end_y)/2))
divide(int((start_x+end_x)/2), end_x, int((start_y+end_y)/2), end_y)
return
import sys
input = sys.stdin.readline
N = int(input())
paper = [list(map(int, input().split())) for _ in range(N)]
divide(0,N,0,N)
print(white_color)
print(blue_color)
π λ¬Έμ λ§ν¬
λΆν μ 볡 ν λ² λ μ 볡νκΈ°
μμ’ μ΄ λ§λ€κΈ°
βοΈ μμλ μκ°
40λΆ
β¨ μλ μ½λ
νμ¬ λ²μ λ΄ μ’ μ΄κ° μ λΆ νλμμΈμ§ νμμμΈμ§ κ²μ¬ν©λλ€.
π μλ‘κ² μκ²λ λ΄μ©