Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 혼공학습단
- 삼성SDS Brightics
- 개인 의료비 예측
- 포스코 청년
- 삼성 SDS
- Brightics
- 팀 분석
- 혼공머신
- 직원 이직여부
- 직원 이직률
- 브라이틱스 서포터즈
- 데이터 분석
- 브라이틱스
- 포스코 아카데미
- Brightics Studio
- Brightics를 이용한 분석
- Brigthics Studio
- 캐글
- Brigthics를 이용한 분석
- 혼공머신러닝딥러닝
- 삼성SDS Brigthics
- 데이터분석
- Brigthics
- 삼성SDS
- 영상제작기
- 혼공
- 노코드AI
- 모델링
- 삼성 SDS Brigthics
- 추천시스템
Archives
- Today
- Total
데이터사이언스 기록기📚
[백준/Python] 1138번(구현)_한 줄로 서기 본문
📌문제 유형
구현 (실버2)
📌문제
📌나의 문제풀이
n = int(input())
left_hight = list(map(int,input().split()))
result = [0] * (n)
cnt = 0
for i in range(len(left_hight)):
for j in range(len(result)):
if result[j] == 0:
if cnt == left_hight[i]:
result[j] = i+1
cnt = 0
break
else:
cnt += 1
print(*result)
📌 다른사람의 문제풀이
n = int(input())
h = list(map(int, input().split()))
ans = [0] * n
for p in range(1, n+1):
t = h[p-1]
cnt = 0
for i in range(n):
if cnt == t and ans[i] == 0:
ans[i] = p
break
elif ans[i] == 0:
cnt += 1
print(*ans)
📌 리뷰
- 구현은 직접 시뮬레이션 해보고 코드 작성하기
728x90
'Coding Test > 백준(Python)' 카테고리의 다른 글
[백준/Python] 7562번(그래프, BFS)_나이트의 이동 (0) | 2023.05.08 |
---|---|
[백준/Python] 2667번(그래프, DFS, BFS)_단지 번호 붙이기 (0) | 2023.05.07 |
[백준/Python] 2583번(그래프, BFS, DFS)_영역 구하기 (0) | 2023.04.28 |
[백준/Python] 1743번(그래프, DFS, BFS)_음식물 피하기 (0) | 2023.04.27 |
[백준/Python] 11403번(그래프 이론, 그래프 탐색, 플로이드-워셜)_경로찾기 (0) | 2023.04.26 |
Comments