한강 조망권 문제 입니다.
T = 10 for test_case in range(1, T + 1): test_length = int(input()) power = list(map(int,input().split())) sample = [] lenth = len(power) num = 0 for i in range(0,lenth) : line = [] num = power[i] for _ in range(0,num) : line.append(1) for _ in range(num,255): line.append(0) sample.append(line) check = 0 # 0 0 1 0 0 0 # 0 0 1 0 0 0 # 0 0 1 1 0 0 # 0 0 1 1 0 0 # 0 0 1 1 0 0 # y 가 행이다 # x 가 층수임. for x in range(0,255) : found = 0 find = 0 for y in range(0,test_length) : if sample[y][x] == 1 and sample[y-1][x] == 0 and sample[y-2][x] ==0 and sample[y+1][x] == 0 and sample[y+2][x] == 0 : check = 1 + check # print ("1번걸림",end = '') else : #print("5번걸림", end= '') found = 0 find = 0 print("#"+str(test_case),check) |
'IT관련 정보' 카테고리의 다른 글
unity has stopped working 에러 유니티 아바타 버전 2018.4.20f1 에러 (2) | 2021.05.11 |
---|---|
라즈베리파이 sudo 스크립트 + python 스크립트 부팅 후 안전 자동 실행 (0) | 2020.12.05 |
[2장] 라즈베리파이4 얼굴추적 카메라 완성 (0) | 2020.11.04 |
초보자용 )python 윈도우 conda기본 셋팅하기 (0) | 2020.09.12 |
vnc viewer 에러 the connection was refused by the computer 뜰때 (1) | 2020.06.23 |
댓글